0

I'm trying to import a SCSS file in a CSS file. The following error appears when I try to compile the project. Has somebody faced this issue? I've looked in internet, but the error explanation is not that clear. Thanks!

ERROR in ./src/styles.css (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/styles.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: ENOENT: no such file or directory, open '\src\theme.scss'

styles.css

@import "/src/theme.scss"; 
2
  • The file theme.scss in src exists? Commented Mar 14, 2019 at 9:54
  • 6
    check the import path.. it should be a relative path , starting from './' or ../. Commented Mar 14, 2019 at 9:55

1 Answer 1

1

You could also add it to the angular.json file like so:

    styles: [
  "src/theme.scss"
            ]   

and it should pick it up.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.