Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #9986
Closed
Open
Issue created Nov 02, 2020 by Administrator@rootContributor

node-sass v5.0.0 compilation error

Created by: nhevia

Describe the bug

Installing node-sass as recommended in the documentation to have SASS support returns following error on compilation:

Error: Node Sass version 5.0.0 is incompatible with ^4.0.0

sass-loader was updated to v10.0.5 for supporting node-sass v5.0.0 (https://github.com/webpack-contrib/sass-loader/pull/899), but react-scripts is pinned to sass-loader 8.0.0. This means that every fresh installation (or update) which is using node-sass will end up with this error on yarn/npm start.

Related issue threads: https://stackoverflow.com/a/64626556/6402990 https://github.com/webpack-contrib/sass-loader/issues/898

Did you try recovering your dependencies?

Not applicable

Which terms did you search for in User Guide?

Not applicable

Environment

All

Steps to reproduce

  1. npx create-react-app sass-error-compilation
  2. cd sass-error-compilation
  3. yarn add node-sass
  4. Modify App.css to App.scss. Change extension in App.js as well.
  5. yarn start

Expected behavior

Scss files compiled to css without sass-loader returning an error.

Actual behavior

Failed to compile.

./src/App.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/App.scss)
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.

Reproducible demo

Assignee
Assign to
Time tracking