1

My React project (made with create-react-app) was ejected before I started the project. I included an SCSS loader in the webpack file.

Now, when I try to run 'npm run build', the following error gets shown:

Invalid CSS after "i": expected 1 selector or at-rule, was "import React from '"

enter image description here

NovoBook
  • 103
  • 1
  • 7

1 Answers1

1

I don't know where exactly I had gone wrong, but it might have been something with css-loader.

I created a fresh project (didn't eject the project this time), installed node-sass-chokidar [guide for using sass/scss in your React project], copied my src folder into the new project, installed all the other dependencies, and finally changed the import statements from '.scss' to '.css'.

This worked.

NovoBook
  • 103
  • 1
  • 7