I just created a Next.js project using npx create-next-app.
Today, I opened my Next.js projects in VS Code and all of the .css imports suddenly start showing this error:
Cannot find module or type declarations for side-effect import of './globals.css' ts(2882)
This happens even on newly created Next.js projects.
I did not update any code or dependencies manually before this issue started. I also tried downgrading TypeScript, but the error persists.
Why is this error suddenly happening, and how can I fix it?
*.d.tsnow? What changed and we do not know?VS-Codeprobably switch the Typescript version for a different version of your current workspace.Click in any ts file -> look at the bottom of the vs-code -> click in Typescript -> then select the same version that is in your package.json. @Magikk @user:20143463