react-app-rewire-scss icon indicating copy to clipboard operation
react-app-rewire-scss copied to clipboard

TypeError: cssRules.loader is not iterable

Open imVinayPandya opened this issue 7 years ago • 4 comments

Hello Developer, i am facing following error when i am running app by npm start

react-app-rewired start

node_modules/react-app-rewire-scss/index.js:26
        use: [...cssRules.loader, { loader: 'sass-loader', options: sassLoaderOptions }],
                          ^

TypeError: cssRules.loader is not iterable
    at /home/vinay/Documents/react/save-simply-web-console/node_modules/react-app-rewire-scss/index.js:26:27
    at Object.override [as webpack] (/home/vinay/Documents/react/save-simply-web-console/config-overrides.js:11:12)
    at Object.<anonymous> (/home/vinay/Documents/react/save-simply-web-console/node_modules/react-app-rewired/scripts/start.js:13:13)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-app-rewired start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vinay/.npm/_logs/2018-09-04T10_17_14_594Z-debug.log

this is happening because cssRules.loader is undefined.

similar issue you can find here: https://github.com/timarney/react-app-rewired/issues/268

Work around i found:

     const cssRuleLoader = cssRules.loader || cssRules.use; 
     
      sassRules = {
        test: sassExtension,
        use: [...cssRuleLoader, { loader: 'sass-loader', options: sassLoaderOptions }],
      };

imVinayPandya avatar Sep 04 '18 10:09 imVinayPandya

If you guys want i can submit PR for this.

imVinayPandya avatar Sep 04 '18 10:09 imVinayPandya

@imVinayPandya you're welcome to submit a PR.

aze3ma avatar Sep 06 '18 20:09 aze3ma

@aze3ma i have submited PR will you please look into that?

imVinayPandya avatar Sep 13 '18 08:09 imVinayPandya

Update your package.json :

"react-app-rewire-sass-rule": "^2.1.3", "react-app-rewired": "^2.1.5",

gp-abhishek avatar Sep 22 '22 09:09 gp-abhishek