question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find a declaration file for module 'react-jss/lib/jss'.

See original GitHub issue

EDIT: 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:closed
  • Created 5 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
pelotomcommented, Aug 22, 2018

Is it safe to close this? Seems like not a MUI issue…

2reactions
eps1loncommented, Aug 20, 2018

I always considered importing from lib or dist 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 the withStyles 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 or require those imports until typings are provided for that package.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found