Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Can't resolve 'react-jss/lib/JssProvider #13146

Closed
2 tasks
sunshixiong789 opened this issue Oct 8, 2018 · 13 comments
Closed
2 tasks

Module not found: Can't resolve 'react-jss/lib/JssProvider #13146

sunshixiong789 opened this issue Oct 8, 2018 · 13 comments
Labels
support: question Community support but can be turned into an improvement v1.x

Comments

@sunshixiong789
Copy link

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Current Behavior

Examples

Context

image

in material-ui 3.2.0, I find I can't use jssprovider. but 1.5.1 I can

@sunshixiong789
Copy link
Author

in 3.2, material-ui cant dependence react-jss

@oliviertassinari oliviertassinari added the support: question Community support but can be turned into an improvement label Oct 8, 2018
@oliviertassinari
Copy link
Member

@sunshixiong789 npm install react-jss and you will be good. See #12993.

@sunshixiong789
Copy link
Author

think you

@sunshixiong789
Copy link
Author

I think it should be like before

@eps1lon
Copy link
Member

eps1lon commented Oct 9, 2018

react-jss was always a transitive dependency. You should not import transitive dependencies. Eslint even has a rule implicit-dependency against that.

@oliviertassinari
Copy link
Member

@sunshixiong789 I'm considering the option of having a WithStylesProvider.

@devamir
Copy link

devamir commented Jul 30, 2019

@oliviertassinari for now doing npm install react-jss solves the problem but in this way we need to install all the dependency's dependency at root of our package.json :(

@oliviertassinari
Copy link
Member

@devamir What version are you using?

@devamir
Copy link

devamir commented Jul 31, 2019

@oliviertassinari I was facing the issue Object(...) is not a function on upgrading the material-ui to 4.x.x and then faced this issue/. It seemed to be the issue that npm install was not installing all the sub-dependencies.

@oliviertassinari
Copy link
Member

react-jss is not a dependency of v4.0.0. We might introduce it back in #16180.

@AleksandarSavic95
Copy link

I think I solved this issue by installing react-jss ^8.0.0. I got that idea after I found this PR: #14237

If You already npm install react-jss, You will probably get v10 of the package. To correct it, just do the following:

  • open package.json
  • and find the "react-jss" dependency and set it to ^8.0.0 instead of ^10.0.0
  • remove react-jss entry from package.LOCK.json (from the .lock file!!)
  • run npm install and hope for the best :)

@eugensunic
Copy link

@AleksandarSavic95

Material-UI depends on JSS v10. JSS v10 is not backward compatible with v9. Make sure JSS v9 is not installed in your environment. (Removing react-jss from your package.json can help). The StylesProvider component replaces the JssProvider one.

https://material-ui.com/guides/migration-v3/

@Hosein-mh
Copy link

in case of need you have to install jss-rtl too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement v1.x
Projects
None yet
Development

No branches or pull requests

7 participants