I'm only starting learning React and faced an issue while importing styles from './TodoOutput.module.scss'
:
Error from TodoOutput.tsx
:
Cannot find module ./TodoOutput.module.scss or its corresponding type declarations.ts(2307)
even though file TodoOutput.module.scss
exists, and both scss
and sass
packages added into both package.json and package-lock.json
Here is TodoOutput/
directory:
Review package.json
Review package-lock.json
Review tsconfig.json
I find the problem. You need to create a Global.d.ts file inside yours src folder and add following lines.
declare module "*.module.css";
declare module "*.module.scss";