Nx: Unable to generate component

Created on 7 Oct 2020  路  6Comments  路  Source: nrwl/nx

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
console bug

All 6 comments

I have encountered this same issue, on v10.2.1.

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

Good point, it's probably more appropriate to move it to this repo: https://github.com/nrwl/nx-console

Looks like they may have already fixed this in 14.0.1:
https://github.com/nrwl/nx-console/commit/8910bca4ad5a8811d1a5e1ff2501b8a446463613

@s4m0r4m4 that resolved it for me, thank you!

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joelmuskwe picture joelmuskwe  路  3Comments

SWGeekPD picture SWGeekPD  路  3Comments

zpydee picture zpydee  路  3Comments

Koslun picture Koslun  路  3Comments

danieldanielecki picture danieldanielecki  路  3Comments