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.

Unable to generate component

See original GitHub issue

Current Behavior

When I attempt to generate a component in VS Code using the Nx Console extension v14.0 I get the following error (see failure log below) even though I am selecting a project from the dropdown.

I am however able to generate a component if I use the terminal commands vs. the extension UI. yarn generate:comp --name="switch" --project="common-components" --export --pascalCaseFiles

Expected Behavior

I expect the dry run to work correctly and not display errors.

This is a regression, it worked fine a couple weeks ago.

Steps to Reproduce

Create a site with multiple projects, attempt to generate a component using the extension.

  • I’m unable to reproduce this using the nx_examples
  • I’m unable to provide the repo because it is private and has code that I’m not allowed to share
  • I’m happy to provide whatever information that I can to help troubleshoot this.

Failure Logs

> Executing task: nx generate @nrwl/react:component --name=switch --export --pascalCaseFiles --no-interactive --dry-run <

Schematic input does not validate against the Schema: {"style":"scss","name":"switch","export":true,"pascalCaseFiles":true}
Errors:

  Data path "" should have required property 'project'.
The terminal process "/bin/bash '-l', '-c', '/Users/MatthewHaff/_work/lisbon-evolution/ui/webserver/node_modules/.bin/nx generate @nrwl/react:component --name=switch --export --pascalCaseFiles --no-interactive --dry-run', 'nx generate @nrwl/react:component --name=switch --export --pascalCaseFiles --no-interactive --dry-run'" terminated with exit code: 1.

Environment

Mac OS X 10.15.6

  @nrwl/angular : Not Found
  @nrwl/cli : 9.6.0
  @nrwl/cypress : 9.6.0
  @nrwl/eslint-plugin-nx : 9.6.0
  @nrwl/express : Not Found
  @nrwl/jest : 9.6.0
  @nrwl/linter : 9.6.0
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : 9.6.0
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.6.0
  @nrwl/web : 9.6.0
  @nrwl/workspace : 9.6.0
  typescript : 3.8.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
s4m0r4m4commented, Nov 9, 2020

@CWSites , cool. I’d say we’re good to close this issue out then!

https://github.com/nrwl/nx-console/pull/980

1reaction
CWSitescommented, Oct 13, 2020

@vsavkin this isn’t happening in the console, it’s happening in the VS Code extension for NX. I am able to correctly generate a component in the console.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular CLI generate component issue - Stack Overflow
The best way is by using Angular CLI with the following command ng generate component sampleComponent or ng g c sampleComponent.
Read more >
Error Message "Unable to create component" when place part ...
Solution: Reason for this message could be that an already existing member of this content center familiy is corrupted and an update fails....
Read more >
ng generate component using the CLI - Pluralsight
ng generate component is a simple one-line command which creates different files and a folder, and it references the newly created component ......
Read more >
Unable to get "Component" in left sidebar - Atlassian Community
You can only use components in classic projects unfortunately. So, yes, you could try to switch to that kind of project if components...
Read more >
Error rendering input when editing a Component Definition
Unable to create component..." error when editing a Component Definition asset? Answer. The Component Definition assets are assets generally found under the / ......
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