Skip to content

Option validation not showing errors #14269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
filipesilva opened this issue Apr 25, 2019 · 2 comments · Fixed by #14315
Closed

Option validation not showing errors #14269

filipesilva opened this issue Apr 25, 2019 · 2 comments · Fixed by #14315

Comments

@filipesilva
Copy link
Contributor

🐞 Bug report

Command (mark with an x)

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

Is this a regression?

Yes, the previous version in which this bug was not present was: 7.x

Description

When using unknown options in angular.json, errors are not shown correctly.

🔬 Minimal Reproduction

npm install -g @angular/[email protected]
ng new validation-proj
cd validation-proj
# edit `angular.json` and change `outputPath` to `notOutputPath`
ng build

🔥 Exception or Error

D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\util\hostReportError.js:4
    setTimeout(function () { throw err; });
                             ^

Error: Options did not validate.[object Object]
    at MapSubscriber.registry.compile.pipe.operators_1.map.result [as project] (D:\sandbox\es2015-forwardref\node_modules\@angular-devkit\architect\src\architect.js:39:31)
    at MapSubscriber._next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\operators\map.js:49:35)
    at MapSubscriber.Subscriber.next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\operators\mergeMap.js:92:26)
    at InnerSubscriber._next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\Subscriber.js:66:18)
    at MapSubscriber._next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\operators\map.js:55:26)
    at MapSubscriber.Subscriber.next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\Subscriber.js:66:18)
    at SwitchMapSubscriber.notifyNext (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\operators\switchMap.js:86:26)
    at InnerSubscriber._next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\Subscriber.js:66:18)
    at D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\util\subscribeTo.js:17:28
    at Object.subscribeToResult (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\util\subscribeToResult.js:10:45)
    at SwitchMapSubscriber._innerSub (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\operators\switchMap.js:65:54)
    at SwitchMapSubscriber._next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\operators\switchMap.js:55:14)
    at SwitchMapSubscriber.Subscriber.next (D:\sandbox\es2015-forwardref\node_modules\rxjs\internal\Subscriber.js:66:18)

🌍 Your Environment





Anything else relevant?
This error reporting seems to come from

'Data did not validate: ' + (errors ? errors.join() : 'Unknown error.'),

cc @istiti

@ngbot ngbot bot added this to the Backlog milestone Apr 25, 2019
@filipesilva filipesilva modified the milestones: Backlog, 8.0 Apr 25, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Apr 26, 2019
    By using the `SchemaValidationException` object, the underlying JSON schema validation errors will be propagated to the consuming code.  This allows for more detailed error reporting of malformed or incorrectly provided options.

Partially addresses angular#14269
clydin added a commit to clydin/angular-cli that referenced this issue Apr 26, 2019
    By using the `SchemaValidationException` object, the underlying JSON schema validation errors will be propagated to the consuming code.  This allows for more detailed error reporting of malformed or incorrectly provided options.

Partially addresses angular#14269
alexeagle pushed a commit that referenced this issue Apr 26, 2019
    By using the `SchemaValidationException` object, the underlying JSON schema validation errors will be propagated to the consuming code.  This allows for more detailed error reporting of malformed or incorrectly provided options.

Partially addresses #14269
alexeagle pushed a commit that referenced this issue Apr 26, 2019
    By using the `SchemaValidationException` object, the underlying JSON schema validation errors will be propagated to the consuming code.  This allows for more detailed error reporting of malformed or incorrectly provided options.

Partially addresses #14269
@filipesilva
Copy link
Contributor Author

#14274 fixed the error message. It still shows a stack trace though, and shouldn't.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.