7

I am building my angular application using the angular CLI command ng test --source-map=false

Everything was working fine, but suddenly I have started encountering the below error

Schema validation failed with the following errors:
Data path ".sourceMap" should be object.
Data path ".sourceMap" should be boolean.
Data path ".sourceMap" should match exactly one schema in oneOf.

On some inspection, the issue seems to originate from the --source-map parameter, but not sure about the exact cause.

2
  • 1
    I have the same problem and it seems it has something to do with the dev-dep @angular-devkit/build-angular. After downgrading this package everything works fine again. Commented Feb 20, 2019 at 8:49
  • 1
    The problem for me was due an incompatible version of @angular-devkit/build-angular with angular 6. Btw. I've downgraded @angular-devkit/build-angular to ~0.8.9 which seems to be the last compatible version. Commented Feb 20, 2019 at 8:59

5 Answers 5

2

There was a bug with the --source-map flag that would throw those errors. The latest version of the @angular-devkit/build-angular has a fix for this (0.13.6).

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

2 Comments

I have @angular-devkit/build-angular 0.13.8 and have the same issue.
angular broke semver it looks like latest version is now 0.8.9 npmjs.com/package/@angular-devkit/build-angular (versions tab)
1

The parameter for source maps is

--sourceMap=true|false

See : https://angular.io/cli/test

1 Comment

This if for Angular 7. For Angular 6 the parameter is as @goyalM has specified.
1

For the latest version,the cmd params is like this " ng build --prod --source-map ".

https://angular.io/guide/deployment#inspect-the-bundles

Comments

1

For me the problem was that i used ngx-build-plus which is not yet based on the Angular CLI 7.2 style config for "sourceMap". The temporary workaround that I used is described here https://github.com/manfredsteyer/ngx-build-plus/issues/88#issuecomment-490433864

Comments

0

Is your command correct.I think it should be ng test --sourcemaps=false

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.