react-toolbox: "Module build failed"

Hello, I get this error when try to start the project…

npm install npm start … Child extract-text-webpack-plugin:

ERROR in ./~/css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!./~/postcss-loader!./~/sass-loader?sourceMap!./components/snackbar/style.scss
Module build failed: 
  @import "./colors";
 ^
      Import directives may not be used within control directives or mixins.
      in /home/amensouissi/workspace_react/react-toolbox/components/_base.scss (line 4, column 3)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 11
  • Comments: 24 (11 by maintainers)

Commits related to this issue

Most upvoted comments

removing the if in _base.scss and just having

@import "./colors";
@import "./globals";
@import "./mixins";

fixes the issue.

Yeah we are removing conditional exports for the next release. It was needed for the toolbox loader but it will be needed no longer with a PR I’m gonna do next weekend

Yeah as you described changing the dependency on node-sass in your package.json to be 3.4.2 instead of ^3.4.2 tells NPM that you want that specific version. The ^ tells NPM to grab the highest minor version that matches. I’m not an expert on NPM’s nuances so I usually just delete a module out of node_modules and do another npm install when I need to force it to a particular version.

@nickretallack I was able to work around this by pinning my peer dependency on node-sass to 3.4.2.

can you please make patch release for this? CI is going nuts due to this error