ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

Schema validation failed: should NOT have additional properties(inject). #531

Closed iamandreadompe closed 4 years ago

iamandreadompe commented 4 years ago

I'm submitting a...

Current behavior

with the following command npm run build if i use inject in angular.json i get this error "Schema validation failed with the following errors: Data path ".styles[1]" should NOT have additional properties(inject). Data path ".styles[1]" should be string. Data path ".styles[1]" should match exactly one schema in oneOf"

My angular.json configuration is

"styles": [
"src/main.scss",
{
"input": "src/theme/sanGiorgio.scss",
"bundleName": "client-b",
"inject": false
}
]

Expected behavior

with npm run build everything goes well

Minimal reproduction of the problem with instructions

"build": {
        ...
        options: {
          ...
          "styles": [
            "src/styles.scss",
            {
              "input": "src/theme/sanGiorgio.scss",
              "bundleName": "sangiorgio",
              "inject": false
            }
          ],
        }
    },

Environment



ngX-Rocket: 7.1.0
Node.js: v10.15.0
Npm: 6.13.6
OS: darwin x64 19.3.0

Generated project options:

{
  "generator-ngx-rocket": {
    "version": "5.3.0",
    "props": {
      "location": "path",
      "appName": "CATAapp",
      "target": [
        "web",
        "cordova"
      ],
      "pwa": true,
      "mobile": [
        "ios",
        "android"
      ],
      "ui": "material",
      "layout": "side-menu",
      "auth": true,
      "lazy": true,
      "angulartics": false,
      "prettier": false,
      "projectName": "cat-aapp",
      "packageManager": "npm"
    }
  }
}

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 7.0.7
Node: 10.15.0
OS: darwin x64
Angular: 7.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.10.7
@angular-devkit/build-angular      0.10.7
@angular-devkit/build-optimizer    0.10.7
@angular-devkit/build-webpack      0.10.7
@angular-devkit/core               7.0.7
@angular-devkit/schematics         7.0.7
@angular/cdk                       7.3.7
@angular/cli                       7.0.7
@angular/fire                      5.2.1
@angular/flex-layout               7.0.0-beta.19
@angular/material                  7.3.7
@angular/material-moment-adapter   7.3.7
@ngtools/webpack                   7.0.7
@schematics/angular                7.0.7
@schematics/update                 0.10.7
rxjs                               6.4.0
typescript                         3.1.6
webpack                            4.19.1

Others:

sinedied commented 4 years ago

Your Angular version is probably too old for these options, as the schema validator tell you that it doesn't know how to handle inject. The angular docs are only valid for the latest Angular version, so you should upgrade your project.