react write ts script import module error:
import style from './style.module.scss' reports an error: TS2307: Cannot find module './style.module.scss' or its corresponding type declarations. It is because there is no relevant declaration in react-app-env.d.ts added in
declare module '*.module.scss' { const classes: { readonly [key: string]: string } export default classes } Saving can solve the problem
Similar Posts:
- DOM style setting methods in the four components of react
- Uncaught SyntaxError: The requested module ‘/node_modules/.vite/react-router……Switch
- How to Solve React-native-gesture-handler Error
- How to deal with the error “cannot read property ‘set state’ of undefined” in react
- React uses antd to import error messages on demand
- Module build failed: Error: Cannot find module ‘node-sass’
- [Solved] Use of create react app on Mac platform (command not found)
- Solve the problem of JS using JSX syntax to report errors in vite react project