cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.08k stars 399 forks source link

TypeError: container.replaceRule is not a function #1570

Closed PedroDivergence closed 3 years ago

PedroDivergence commented 3 years ago

Expected behavior: A clear and concise description of what you expected to happen. React-Create-App web app: After running npm start or npm run build the app crashes.

Describe the bug: A clear and concise description of what happened instead of the expected behavior.

TypeError: container.replaceRule is not a function
Array.onProcessStyle
node_modules/jss-plugin-nested/dist/jss-plugin-nested.esm.js:84
  81 | 
  82 |   selector = selector.replace(refRegExp, replaceRef);
  83 |   var name = styleRule.key + "-" + prop;
> 84 |   container.replaceRule(name, style[prop], _extends({}, options, {
     | ^  85 |     selector: selector
  86 |   }));
  87 | } else if (isNestedConditional) {

Reproduction: React-Create-App web app: After running npm start or npm run build the app crashes.

Add a failing test to the suite and submit a PR. A test is even better than a fix. Alternatively create a codesandbox.io with the issue. Make it as minimal as possible as this will help us find the bug quicker.

Versions (please complete the following information):

Managing expectations:

Maintainers will not be fixing the problem you have unless they have it too, if you want it to get fixed:

  1. Submit a PR with a failing test
  2. Discuss a solution
  3. Implement it

You can also do the first step only and wait for someone else to work on a fix. Anything is much better than nothing.

souad91 commented 3 years ago

This issue appear in version 10.8.1 but today they published new version fixed it.

kof commented 3 years ago

should be fixed in 10.8.2