declare module '*.css' { const content: { [className: string]: string }; export default content; }
I’m using Next.js with TypeScript, and when importing the global CSS file like this:
import './globals.css';
TypeScript shows an error in the editor (not during runtime):
Cannot find module or type declarations for side-effect import of './globals.css'.
The app runs fine, but the error appears inline in the code and causes TypeScript warnings.
How can I fix this TypeScript error properly?