nx g c – InvalidInputOptions [Error]: Schematic input does not validate against the Schema
See original GitHub issueCurrent Behavior
Run nx g c ...
with @nrwl/angular:component
returns error message
InvalidInputOptions [Error]: Schematic input does not validate against the Schema: ``{"style":"scss","project":"admin","name":"libs/shared/feature-head-contractor/src/lib/company-list-container","displayBlock":false,"inlineStyle":false,"inlineTemplate":false,"standalone":false,"changeDetection":"Default","skipTests":false,"flat":false,"skipImport":false,"skipSelector":false,"type":"component","export":false}
Errors:
Data path "" must NOT have additional properties(standalone).
at MapSubscriber.project (/Users/chriscurnow/Projects/4cast/workspace/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js:30:27) at MapSubscriber._next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/operators/map.js:49:35) at MapSubscriber.Subscriber.next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/Subscriber.js:66:18) at ThrowIfEmptySubscriber._next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/operators/throwIfEmpty.js:44:26) at ThrowIfEmptySubscriber.Subscriber.next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/Subscriber.js:66:18) at TakeSubscriber._next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/operators/take.js:54:30) at TakeSubscriber.Subscriber.next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/Subscriber.js:66:18) at MergeMapSubscriber.notifyNext (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/operators/mergeMap.js:93:26) at SimpleInnerSubscriber._next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/innerSubscribe.js:27:21) at SimpleInnerSubscriber.Subscriber.next (/Users/chriscurnow/Projects/4cast/workspace/node_modules/rxjs/internal/Subscriber.js:66:18) { errors: [ { instancePath: '', schemaPath: '#/additionalProperties', keyword: 'additionalProperties', params: [Object], message: 'must NOT have additional properties' } ] }
Expected Behavior
Component is created
Steps to Reproduce
Run nx g c
with component path
I updated to Nx 14.2.2 yesterday. Other generators have been working today eg:
nx g lib
nx g ngrx
When I run nx g c
now, it says
? Which generator would you like to use? …
@schematics/angular:component
@nrwl/angular:component
None of the above
The problem occurs when I chose @nrwl/angular:component
which is what I have used previously when using the contextual menu option nx generate
.
Environment
Node : 16.15.1 OS : darwin arm64 npm : 8.12.1
nx : 14.2.4 @nrwl/angular : 14.2.4 @nrwl/cypress : 14.2.4 @nrwl/detox : Not Found @nrwl/devkit : 14.2.4 @nrwl/eslint-plugin-nx : 14.2.4 @nrwl/express : Not Found @nrwl/jest : 14.2.4 @nrwl/js : Not Found @nrwl/linter : 14.2.4 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/nx-plugin : Not Found @nrwl/react : Not Found @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.2.4 @nrwl/web : Not Found @nrwl/workspace : 14.2.4 typescript : 4.7.3
Community plugins: @ngrx/component-store: 13.2.0 @ngrx/effects: 13.2.0 @ngrx/entity: 13.2.0 @ngrx/router-store: 13.2.0 @ngrx/store: 13.2.0 rxjs: 6.6.7 @ngrx/schematics: 13.2.0 @ngrx/store-devtools: 13.2.0
Issue Analytics
- State:
- Created a year ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
@leosvelperez thanks so much for this. Yes it works!! I really appreciate how quickly you responded to the issue and found a fix for me…
@chriscurnow thanks for providing a reproduction! The issue is that the
@schematics/angular
in your package.json is set to version^13.2.6
and it should actually be aligned with the rest of the versions of the angular packages (e.g.@angular-devkit/build-angular
, 14.0.1 in your workspace).I can see the migration didn’t update that package version automatically. I’ll push a fix for that so anyone that migrates in the future doesn’t face the same issue.
For anyone having this issue as of now, please check if you have the
@schematics/angular
package in your package.json and make sure it’s updated to the same version the@angular-devkit/build-angular
package has.If you don’t have the package listed in the package.json but you’re having the same issue, you might have other packages that depend on an older version of the same and it’s causing it to be hoisted with that older version. In those cases, you could add the package to your
devDependencies
with a version that matches the mentioned@angular-devkit/build-angular
package.