[react-scripts 3.4.0] SCSS file with import statement cause resolve-url-loader: CSS error
See original GitHub issueDescribe the bug
After upgrading from react-scripts 3.2.0 to 3.4.0 in a project which imports a simple SCSS file with an @import statement, running yarn build
consistently fails with:
$ react-scripts build
Creating an optimized production build...
Failed to compile.
./src/index.scss
Error: resolve-url-loader: CSS error
Invalid mapping: {"generated":{"line":1,"column":63},"source":"file:///home/circleci/project/src/index.scss","original":{"column":null},"name":null}
Steps to reproduce
Here’s a very simple repro created by:
npx create-react-app
yarn add node-sass
- create a
index.scss
file containing@import url("https://fonts.googleapis.com/css?family=Open+Sans");
- import
index.scss
fromApp.js
Links
- Repro url: https://github.com/simoneb/cra-3.4.0-sass-repro
- CircleCI build showing the build error: https://app.circleci.com/jobs/github/simoneb/cra-3.4.0-sass-repro/1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:21 (5 by maintainers)
Top Results From Across the Web
Node Error: resolve-url-loader: CSS error - Stack Overflow
I had this same error. To fix this, I had to navigate to. node_modules/resolve-url-loader. open. index.js. and under var options change ...
Read more >React Js Css Loader Gives An Failed To Compile Issue - ADocLib
Ask questions[reactscripts 3.4.0] SCSS file with import statement cause resolveurlloader: CSS error. ! Please note that your issue will be fixed much.
Read more >Error node-sass version 5 0 0 is incompatible with 4 0 0
scss file to the App component I am getting this error: Failed to compile. ./src/App.scss (./node_modules/css-loader/dist/cjs.js??ref--5 ...
Read more >Create-react-app my-app takes 1.5 - 2 hours. Why?
This package will no longer receive updates. warning react-scripts > webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+ ...
Read more >react-scripts | Yarn - Package Manager
Create React App 5.0.1 is a maintenance release that improves compatibility with React 18. We've also updated our templates to use createRoot and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, strange. I changed this
to this (without quotes)
and it worked
Just encountered the error and this worked for me. weird… 🤔