question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nx g c – InvalidInputOptions [Error]: Schematic input does not validate against the Schema

See original GitHub issue

Current 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:closed
  • Created a year ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chriscurnowcommented, Jun 17, 2022

@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…

1reaction
leosvelperezcommented, Jun 16, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schematic input does not validate against the Schema: {"name":"
This error is possible of avoiding naming standards. Project name can not have underscore '_' . It can have dashes '-' , small...
Read more >
Schematic input does not validate against the Schema: {"name":"
Coding example for the question Schematic input does not validate against the Schema: {"name":"testng7"} on Angular 7-angular.js.
Read more >
nrwl-nx/community - Gitter
Figured out my problem - seems that having configuration in angular.json for other schematics to skip tests interferes with NX generating a library....
Read more >
Create new Angular CLI Project is failing due to issue running ...
What happens instead? An error is shown in the Run tab, as follows: Schematic input does not validate against the Schema: {"directory ...
Read more >
解决angular cli生成组件报错 - CSDN博客
angular cli 版本:13.3.1执行ng g c test/hello 报错:Schematic input does not validate against the Schema: {"styleext":"less" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found