Skip to content
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

Obscure message about configuration schema #2226

Open
PhiLhoSoft opened this issue Jan 20, 2022 · 5 comments
Open

Obscure message about configuration schema #2226

PhiLhoSoft opened this issue Jan 20, 2022 · 5 comments
Labels

Comments

@PhiLhoSoft
Copy link

Type of Issue

[ ] Bug Report
[X] Feature Request

Description

I got the error message:

Configuration doesn't match the required schema.
Data path "" must NOT have additional properties (name).

I find it quite obscure, I suggest to improve it, somehow.

How To Reproduce

After upgrading to Angular 13, I got a warning that putting configuration in package.json is deprecated.
The issue #2176 is related: the documentation doesn't reflect this yet.
But I moved the configuration of all our libraries to ng-package.json files and removed it from the package.json files.
A long process as some of them have several secondary-entrypoints, with specific configuration.
And I got the above error.

Expected Behaviour

First, I didn't know what part of the build process generated this error. After some searches, I found out it was ng-packagr. A prefix would be welcome.
Second, I didn't know what configuration file it was. A relative path would be welcome!
Last, the empty data path is obscure, when you meet the message for the first time. Perhaps indicating <root> or similar would be clearer?

I finally understood what the problem was…
For the record (and those searching for this error), it was because I forgot to change angular.json > projects.lib.architect.build.options.project to ng-package.json from package.json… 🙃😑

Version Information

> node_modules\.bin\ng-packagr --version   
ng-packagr:            13.1.3
@angular/compiler:     13.1.2
rollup:                2.63.0
typescript:            4.5.4
@alan-agius4
Copy link
Member

Duplicate of angular/angular-cli#11479

@alan-agius4 alan-agius4 marked this as a duplicate of angular/angular-cli#11479 Jan 20, 2022
@alan-agius4 alan-agius4 marked this as not a duplicate of angular/angular-cli#11479 Jan 20, 2022
@alan-agius4
Copy link
Member

Actually reading the error message again, this one is coming from our schema validation.

@alan-agius4 alan-agius4 reopened this Jan 20, 2022
@kaydeejay
Copy link

@alan-agius4 or @PhiLhoSoft were you able to find a workaround? I am experiencing the same error after upgrading my application to angular 14.

@PhiLhoSoft
Copy link
Author

@kaydeejay I indicate how I solved my problem at the end of my initial message.
But since it seems to be a schema validation issue, you have to check carefully your file, the problem can come from anywhere.
Perhaps after upgrade it is more picky, or some requirements have changed.
The issue was mostly a request for having clearer error messages, hopefully someday indicating which part of the file is faulty.

@kaydeejay
Copy link

@kaydeejay I indicate how I solved my problem at the end of my initial message. But since it seems to be a schema validation issue, you have to check carefully your file, the problem can come from anywhere. Perhaps after upgrade it is more picky, or some requirements have changed. The issue was mostly a request for having clearer error messages, hopefully someday indicating which part of the file is faulty.

Turns out I actually had to do the exact same thing you did. I had already removed the ng-packagr config into its own ng-packagr.json file but I wasn't pointing to it in angular.json.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants