I'm just starting out with Angular 6, using the Angular CLI and getting familiar with the file structure. I intend on using SCSS to create a singular global stylesheet. However, when i compile i am receiving the error:
ERROR in ./src/app/top-bar/top-bar.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
// Copyright Joyent, Inc. and other Node contributors.
^
Invalid CSS after "...N THE SOFTWARE.": expected 1 selector or at-
rule, was "var formatRegExp = "
in /Users/me/Documents/projects/node_modules/util/util.js
(line 1, column 1)
My custom scss folder is located under src/assets/scss.
My top-bar component is located under src/app/top-bar.
I am trying to access src/assets/scss/app.scss in src/app/top-bar/top-bar.component.scss and receiving the above error.
I've tried numerous ways of importing the file @import "~/assets/scss/app.scss"; and @import "../assets/scss/app.scss"; to include the necessary variables but i cant be sure of what i'm doing wrong as the error seems vague and not pointed at any specific file besides a core angular utility.
If anyone can shed some light, even on the debugging process for such an error it would help immensely.
npm install node-sass? did it go ok ?node-sassas well to see if that was the case.//is invalid in CSS but its ok inSCSSyour'e failing on that. this makes me think your SCSS is not compilingangular.jsonfile content