Jss: export 'SheetsManager' was not found in 'jss'

Created on 13 Jun 2019  路  16Comments  路  Source: cssinjs/jss

Incorrect import of SheetsManager in react-jss in 10.0.0-alpa-17

Most helpful comment

This was a mistake in my webpack file, and I'm not entirely sure what in JSS 10 broke my build. I was doing something like

resolve: {
    modules: ["./src", "./node_modules"]
}

So that I could do things like

import MyComponent from 'components/MyComponent';

This was _maybe_ normal in webpack 3.x and I didn't notice the alias feature in webpack 4. Anyway when I changed this (which was totally not obvious to find) the JSS errors went away.

All 16 comments

Can you please provide some more info about the issue.

Preferably even a codesandbox

I am also running into this issue. I believe it is due to one of my project's dependencies (Material UI v3) having a dependency of JSS v9, while I was attempting to update the rest of my project to JSS v10.

If you are running into this issue, run npm ls jss to list any dependencies that depend on JSS, and upgrade those dependencies if possible.

I tried JSS on old project without material-ui. I just Istalled react-jss and got the error. It might be export 'anything' was not found in 'jss', not only SheetsManager. So i decided to use { makeStyles } from material-ui without material components in project. It works.

I am seeing the same warning with 10.0.0 and npm ls jss shows only 10.0.0 in use. I was trying to upgrade from 8.x of react-jss.

@kevinludwig could you please add more information

This was a mistake in my webpack file, and I'm not entirely sure what in JSS 10 broke my build. I was doing something like

resolve: {
    modules: ["./src", "./node_modules"]
}

So that I could do things like

import MyComponent from 'components/MyComponent';

This was _maybe_ normal in webpack 3.x and I didn't notice the alias feature in webpack 4. Anyway when I changed this (which was totally not obvious to find) the JSS errors went away.

@kevinludwig Could it be that you have a src/jss.js file which was then used by webpack to resolve any references to jss?

@HenriBeck I got the same error "export 'SheetsManager' was not found in 'jss' Im using 10.0.0 and this started after I set in tsconfig.json

 "baseUrl": "src"

Check that you do not have "modules" under "resolve" in your webpack config. Remove it.

@alex-shamshurin Im using Create React App

Do eject and check it out.

@codler I doubt this is an issue of jss but instead connected to your configuration.

No, just try it.

It is an issue in jss

Then please provide a reproducible codesandbox

For what it's worth, I had the same issue when I had a webpack.config.js that looked like this:

module.exports = {
  // ...
  resolve: {
    // ...
    modules: ["src", "node_modules"]
  }
}

and it went away when I changed it to this:

const path = require('path');
module.exports = {
  // ...
  resolve: {
    // ...
    modules: [path.resolve(__dirname, 'src'), "node_modules"]
  }
}
Was this page helpful?
0 / 5 - 0 ratings