Skip to content

support typescript option noUncheckedSideEffectImports #88197

@Janpot

Description

@Janpot

Link to the code that reproduces this issue

https://github.com/stefanprobst/issue-next-no-unchecked-side-effect-imports

To Reproduce

  1. clone repo and install dependencies
  2. pnpm tsc --noEmit
  3. see error message:
    app/layout.tsx:3:8 - error TS2307: Cannot find module './globals.css' or its corresponding type declarations.
    
    3 import "./globals.css";
    

Current vs. Expected behavior

should support typescript option noUncheckedSideEffectImports (introduced in v5.6)

probably needs .d.ts for .css imports

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #202403151937 SMP PREEMPT_DYNAMIC Fri Mar 15 19:52:22 UTC 2024
  Available memory (MB): 31401
  Available CPU cores: 16
Binaries:
  Node: 22.8.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 9.9.0
Relevant Packages:
  next: 14.2.11 // Latest available version is detected (14.2.11).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.6.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

TypeScript

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

This is a copy of #70106. Requested in #70165 (reply in thread)

The issue becomes more relevant now that the noUncheckedSideEffectImports option becomes default in the upcoming typescript major.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptRelated to types with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions