Could not find a declaration file for module 'react-jss/lib/jss'.
See original GitHub issueEDIT: I’m using typescript.
Hello, even if I already googled it, I’m not able to solve it.
Could not find a declaration file for module 'react-jss/lib/jss'.
Try `npm install @types/react-jss` if it exists or add a new declaration (.d.ts)
file containing `declare module 'react-jss';`
I know is potentially an issue with JSS and not MUI, but has someone solved this?
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module 'react-jss/lib/jss'.
One way I'm used: const Jss = require('react-jss/lib/jss'); Btw, I'm not sure that this will help.
Read more >Could not find a declaration file for module 'module-name ...
Here are two other solutions. When a module is not yours - try to install types from @types : npm install -D @types/module-name....
Read more >Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve the...
Read more >could not find a declaration file for module 'file-saver' - You.com
I am learning Angular 2 and I am trying to Download the Excel file in angular 2 by fetching customer data from sql...
Read more >How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d.ts) file containing `declare module 'XYZ';. If XYZ is a direct...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is it safe to close this? Seems like not a MUI issue…
I always considered importing from
lib
ordist
or basically anything other than top level files to be bad practice. They do help tree shaking but if the publisher considers them private you have no guarantee that your package won’t break on the next patch.Imports from
react-jss/lib/*
are currently scattered throughout the repo. Most of them can be transformed to imports from top level but thewithStyles
implementation relies on some internals.Maybe we should open an issue over at
react-jss
and ask if they consider those imports save across minor version bumps and then work on proper ts definitions over at DefinitelyTyped.For now you have to
@ts-ignore
orrequire
those imports until typings are provided for that package.