Angular-cli: Angular Universal: Schema validation failed with the following errors: Data path "" should NOT have additional properties(index).

Created on 23 Aug 2018  路  6Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

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

Versions


Node v10.5.0
NPM v6.1.0

Angular CLI: 6.0.8
Node: 10.5.0
OS: win32 x64
Angular: 6.0.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 6.0.8
@angular/platform-server 6.1.4
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2
webpack 4.8.3

Repro steps


ng serve or npm run build:ssr

The log given by the failure


Schema validation failed with the following errors:
Data path "" should NOT have additional properties(index).
npm ERR! code ELIFECYCLE

Desired functionality


No errors.

Mention any other details that might be useful


I am trying to implement Angular Universal, I have followed this article
https://angular.io/guide/universal
I did go through other articles with similar problems, all of them say to downgrade npm package versions to 0.6.3. I currently run the latest cli, hence opening this issue. Please let me know if additional details are needed

devkibuild-angular repro steps

All 6 comments

Can you try if the problem was solved in the lastest @angular/cli and @angular-devkit/<package> changes? Ie 6.1.4 and 0.7.4 respectively.

Otherwise if the problem persists, Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

I did update to the latest versions as you mentioned. I will setup a repro and will update you with the link, while I do that. Please have a look the package.json to make sure I did it right.

{
  "name": "pdp-poc",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
    "serve:ssr": "node dist/server",
    "build:client-and-server-bundles": "ng build --prod && ng run angular.io-example:server",
    "webpack:server": "webpack --config webpack.server.config.js --progress --colors",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/architect": "^0.7.5",
    "@angular-devkit/architect-cli": "^0.7.5",
    "@angular-devkit/build-ng-packagr": "^0.7.5",
    "@angular-devkit/build-optimizer": "^0.7.5",
    "@angular-devkit/build-webpack": "^0.7.5",
    "@angular-devkit/core": "^0.7.5",
    "@angular-devkit/schematics": "^0.7.5",
    "@angular-devkit/schematics-cli": "^0.7.5",
    "@angular-devkit/schematics-tools": "0.0.1",
    "@angular/animations": "^6.1.4",
    "@angular/common": "^6.1.4",
    "@angular/compiler": "^6.1.4",
    "@angular/core": "^6.1.4",
    "@angular/forms": "^6.1.4",
    "@angular/http": "^6.1.4",
    "@angular/platform-browser": "^6.1.4",
    "@angular/platform-browser-dynamic": "^6.1.4",
    "@angular/platform-server": "^6.1.4",
    "@angular/router": "^6.1.4",
    "@nguniversal/express-engine": "^6.1.0",
    "@nguniversal/module-map-ngfactory-loader": "^6.1.0",
    "core-js": "^2.5.4",
    "http-server": "^0.11.1",
    "ngx-gallery": "^5.6.1",
    "rxjs": "^6.2.2",
    "ts-loader": "^4.5.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.6.8",
    "@angular/cli": "^6.1.5",
    "@angular/compiler-cli": "^6.1.4",
    "@angular/language-service": "^6.1.4",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.5",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~2.9.2"
  }
}

Hi @scorpion-3, can you try to upgrade @angular-devkit/build-angular to 0.7.x? As this issue might have been resolved in another release.

Also all these dependencies shouldn't be needed in your package.json, as they are dependencies internally within @angular-devkit/build-angular and @angular/cli

    "@angular-devkit/architect": "^0.7.5",
    "@angular-devkit/architect-cli": "^0.7.5",
    "@angular-devkit/build-ng-packagr": "^0.7.5",
    "@angular-devkit/build-optimizer": "^0.7.5",
    "@angular-devkit/build-webpack": "^0.7.5",
    "@angular-devkit/core": "^0.7.5",
    "@angular-devkit/schematics": "^0.7.5",
    "@angular-devkit/schematics-cli": "^0.7.5",
    "@angular-devkit/schematics-tools": "0.0.1",

after updating to the latest version it got fixed. hence closing this issue. Thanks a lot for the help!

Create a fresh ng project using latest angular-cli and compare angular.json with your project's angular.json.
You might be able to figure our the issue.

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

brtnshrdr picture brtnshrdr  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

naveedahmed1 picture naveedahmed1  路  3Comments

daBishMan picture daBishMan  路  3Comments

hartjo picture hartjo  路  3Comments