39

What is wrong with the new version of Angular? Angular CLI 12.0.1 can't create new application. Tried to run ng new twelveApp and the cli complains dying Data path "" must NOT have additional properties (styleext).

I have tried to set the ng-new schema additionalProperties to true but the error remains.

How to get rid of this additional property?

PS: back to @angular/[email protected] everything works quite perfectly.

3
  • I created a GitHub issue for this. Commented May 25, 2021 at 19:58
  • 1
    in case you are using angular13 Ref: stackoverflow.com/questions/70344098/… Commented Dec 31, 2021 at 3:05
  • @Arun VC Have the same issue but the problem is with "styleext" Commented Feb 6, 2022 at 20:30

14 Answers 14

69

Try to change

  "schematics": {
    "@schematics/angular:component": {
      "styleext": "scss"
    }
  },

to

  "schematics": {
    "@schematics/angular:component": {
      "style": "scss"
    }
  },

In angular.json. Let me know if this works.

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

5 Comments

This works great in angular 12, styleext works in angular 6.x
This is the right answer for >= Angular 12
Wish this was my issue... My variable was already style
im already on style :(
works with Angular 13.x.x
27

Based on the answer to this issue, I edited .angular-config.json file in my home directory and removed the schematics section as shown below. Your particular case might require a variation of this solution.

{
  "schematics": {
    "@schematics/angular:component": {
      "styleext": "scss"
    }
  }
}

5 Comments

Do this have any secondary effects on the project?
Not that I am aware of.
The section configures the behaviour of ng generate as documented here. Therein, the json schema is linked and doesn't contain a field styleext in the latest version.
None of these is working for me. I'm using angualr 13. Any ideas on how to get this rexolved?
Oh. It's the .angular-config.json in my HOME directory ( /users/Username/.angular-config.json ). I thought it was the angular.json of my project's directory.
14

styleext has been renamed to only style a while ago (see Farhans answer above), so maybe that's your issue

1 Comment

Thx, change the line "styleext :"sccs" for "style":"scss" works for me !
5

open file:

angular.json and change the

"styleext": "scss"

to: "style": "scss", like that:

enter image description here

Comments

1

in angular.json, remove this entry:

"extractCss": true,

This fixed my build in Angular: 13.1.2

Comments

0
  1. open your angular.json file

  2. delete these lines of code (you might find them written twice )

    "schematics": { "@schematics/angular:component": { "styleext": "scss" } },

Comments

0

Edit your angular.json file (most likely located at the root of your project) and look for the schematics object. Remove the property styleext: "css" because it is not a valid property for your project.

Before edit

"@schematics/angular:directive": {
      "prefix": "app",
      "styleext": "css"
    }

After edit

"@schematics/angular:directive": {
      "prefix": "app"
    }

Comments

0

I had to remove it from my global angular cli settings to get it working. You can see your global config using this command "ng config -g"

enter image description here

Comments

0

While triggering the build (library build) using ng build, I too got this error. For me, it was a style: [] property in angular.json -> projects -> architect -> build -> options After removing style: [], I could see the library distribution (dist) folder generated. Hope this helps!

Comments

-1

angular.json

"schematics": {
    "@schematics/angular:component": {
      "style": "scss"
    },
    "@schematics/angular:application": {
      "strict": true
    }
  },

1 Comment

Please use comments to explain why you are suggesting the changes your propose and/or how your suggestion solves the issue.
-1

Open this path C:\Users\yourUserNameOnWindows\.angular-config.json if your user is A you write: C:\Users\A\.angular-config.json it will open JSON file, delete this from the file:

{
  "schematics": {
    "@schematics/angular:component": {
      "styleext": "scss"
    }
  }
}

Comments

-1

In addition to the answer provided above by mhusaini, please check the angular.json file within your angular project. You'll see a structure similar to:

{
  "projects": {
    "your-angular-app": {
      ...
      "schematics": {
        "@schematics/angular:component": {
          "styleext": "scss"
        }
      }
    }
  }
}

The solution variant required removing the content from within the schematics element.

Comments

-2

Open this path C:\Users\your user name

then you will find .angular-config.json

Kill it ;)

1 Comment

could you explain ?
-3

"schematics": { "@schematics/angular:component": { "prefix": "app", // "styleext": "scss" // Change this to below value this works for me. "style": "scss"
},
"@schematics/angular:directive": { "prefix": "app" } },

1 Comment

A good answer will always include an explanation why this would solve the issue, so that the OP and any future readers can learn from it

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.