Angular 12 Data path "" must NOT have additional properties (styleext)

Viewed 21036

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/cli@11.0.5 everything works quite perfectly.

11 Answers

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.

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"
    }
  }
}

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

  1. open your angular.json file

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

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

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"
    }

in angular.json, remove this entry:

"extractCss": true,

This fixed my build in Angular: 13.1.2

angular.json

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

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"
    }
  }
}

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.

Open this path C:\Users\your user name

then you will find .angular-config.json

Kill it ;)

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

Related