Angular-cli: angular with sass not getting compiled in angular V 8.0.0 rc4

Created on 22 May 2019  ยท  7Comments  ยท  Source: angular/angular-cli

I have created angular sample with sass compilation, Using angular/cli v8.0.0-rc.4.

while running this sample, below issue occurs.

Error message:
ERROR in ./src/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--13-3!./src/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):

undefined
^
Top-level selectors may not contain the parent selector "&".
โ•ท
219 โ”‚ โ”Œ &.e-bigger .e-switch-wrapper,
220 โ”‚ โ”‚ &.e-bigger.e-switch-wrapper,
221 โ”‚ โ”‚ &.e-bigger .e-css.e-switch-wrapper,
222 โ”‚ โ”‚ &.e-bigger.e-css.e-switch-wrapper {
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€^

Screenshot
sass

My package.json file
angular-version

Repo steps:

Most helpful comment

@Saranya13, Ideally you raise this issue with the library authors of @syncfusion as their code is not compatible with sass

All 7 comments

Hi, in version 8, we moved away from node-sass in favor of sass and it has some differences. The main once being https://www.npmjs.com/package/sass#behavioral-differences-from-ruby-sass

From sass point of view, this code pattern is considered as a mistake in coding and should produce and error. See: https://github.com/sass/sass/issues/1873

Nonetheless you have the option to use opt-in and use node-sass if you manually install it using the below:

npm install node-sass --save-dev

HI @alan-agius4 ,

Thanks for your fast reply...!

As per your answer, can i have to install

npm install node-sass --save-dev

Then this issue will get resolved, is it?

@Saranya13, Ideally you raise this issue with the library authors of @syncfusion as their code is not compatible with sass

HI @alan-agius4 ,

I have checked with them already, but only in latest angular throws this error

how can i raise question to them?

Because the error is thrown by sass, which Angular CLI uses to build sass instead of node-sass.

HI @alan-agius4 ,

Thanks for your reply

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings