-
-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Description
Describe the bug
In 3.1.0 the resolve-url-loader
lib was added that breaks SASS modules composition. Either removing the lib from the webpack config or downgrading to 3.0.1 fixes the issue.
Did you try recovering your dependencies?
Yes. Deleted node-modules
and removed the package-lock.json
.
Environment
Environment Info:
System:
OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
Node: 12.6.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.10.1 - /usr/local/bin/npm
Browsers:
Chrome: 77.0.3865.75
Firefox: 66.0.3
Safari: 12.1.2
npmPackages:
react: ^16.9.0 => 16.9.0
react-dom: ^16.9.0 => 16.9.0
react-scripts: 3.1.1 => 3.1.1
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
npx create-react-app test_app && cd test_app
yarn add node-sass
- Create
b.module.sass
with
.test
background: #FFF
- Create
a.module.sass
with
.test
composes: test from './b.module.sass`
- In
App.js
add as the first lineimport './a.module.sass'
yarn start
and observe the error
- Rename
b.module.sass
tob.module.css
and replace the contents with
.test {
background: #FFF;
}
- In
a.module.sass
changeb.module.sass
tob.module.css
- Observe that the error is gone
Expected behavior
Build succeeds.
Actual behavior
Build fails.
./src/b.module.sass (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-6-3!./src/b.module.sass)
Error: resolve-url-loader: CSS error
./src/b.module.sass:2:3: Unknown word
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser
Reproducible demo
itti, a-tokyo, imjoshdean-tc, wedi, jcreighton and 8 more