Angular-cli: Regression in 7.3.0 when choosing SASS as preprocessor

Created on 31 Jan 2019  路  7Comments  路  Source: angular/angular-cli

馃悶 Bug report

Command (mark with an x)


- [x] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?


Yes, the previous version in which this bug was not present was: All 7.x before 7.3.0

Description

When choosing Sass as the stylesheet preprocessor, CLI produces styles.scss but angular.json expects styles.sass.
Previous available choice of "Scss" is gone.

馃敩 Minimal Reproduction

  1. ng new
  2. Choose Sass as the stylesheet format
  3. ng build or ng serve

馃敟 Exception or Error

ERROR in multi ./src/styles.sass
Module not found: Error: Can't resolve '[...]/src/styles.sass' in '[...]'

[...] above refers to the project folder.

schematicangular medium regression bufix

Most helpful comment

I have the same bug. Just updated my CLI to latest 7.3.0 and then created a new project... choose sass.. (which is scss)

but there is a typo in the cli source code (i guess)

The angular.json is invalid:

  "projects": {
    "angular-skeleton": {
      "schematics": {
        "@schematics/angular:component": {
          "style": "sass"
        }
      },
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "styles": [
              "src/styles.sass"
            ],

sass should be scss here

All 7 comments

Thank you, wkurniawan07! I spent a good half a day wrestling this one... checked my setup environment in a million places after not finding anything on Google yesterday. Even started a thread on Stack Overflow: https://stackoverflow.com/questions/54463979/angular-7-cli-generated-project-throws-error-in-multi-src-styles-sass

I have the same bug. Just updated my CLI to latest 7.3.0 and then created a new project... choose sass.. (which is scss)

but there is a typo in the cli source code (i guess)

The angular.json is invalid:

  "projects": {
    "angular-skeleton": {
      "schematics": {
        "@schematics/angular:component": {
          "style": "sass"
        }
      },
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "styles": [
              "src/styles.sass"
            ],

sass should be scss here

I have zero experience with the internals of Angular but could this bug be caused by line 129 in this file? https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/ng-new/schema.json

I'm wondering if value is supposed to be scss and not sass. I have no idea how the templates actually get generated so I could be way off. But without running the tool in a local dev environment it's my best guess.

I have number of files with extension .scss. Do i have to change the extension to scss to sass?

@karamjeetiron, no you don't have too.

The extension should be scss and not sass. We stopped offering sass as file extension for new projects.

See https://github.com/angular/angular-cli/pull/13444

This has been corrected in CLI 7.3.1 and all newly generated applications will contain the correct file extensions. Existing projects suffering from this issue will need to manually update the file extension in angular.json as noted above.

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

Related issues

rwillmer picture rwillmer  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

daBishMan picture daBishMan  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments