nrwl / nx-console

Nx Console is the user interface for Nx & Lerna.
https://nx.dev
MIT License
1.3k stars 212 forks source link

nx console generator path argument bug #2168

Closed jonesp1 closed 2 weeks ago

jonesp1 commented 3 weeks ago

We have our own generators and they used to work, but they don't anymore, it looks like some package updates is causing the problem

When we run this command pnpm exec nx generate @nx:library --name=test --no-interactive --verbose

TypeError: The "path" argument must be of type string. Received undefined at validateString (node:internal/validators:162:11) at join (node:path:1175:7) at Object. (/workspaces/nodemodules/.pnpm/@nx+jest@17.3.2@babel+traverse@7.24.7@swc-node+register@1.9.2@swc+core@1.5.29_@swc+helpers/node_modules/@nx/jest/src/plugins/plugin.js:15:35) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Object.newLoader [as .js] (/workspaces/WATS/node_modules/.pnpm/pirates@4.0.6/node_modules/pirates/lib/index.js:121:7) at Module.load (node:internal/modules/cjs/loader:1207:32) at Function.Module._load (node:internal/modules/cjs/loader:1023:12) at Module.require (node:internal/modules/cjs/loader:1235:19) at Module.Mod.require (/workspaces/nodemodules/.pnpm/nx@19.2.3@swc-node+register@1.9.2@swc+core@1.5.29@swc+helpers@0.5.11__@swc+types@0.1.8_typ/node_modules/nx/bin/init-local.js:154:36)

MaxKless commented 3 weeks ago

hey can you provide the nx report like the bug template asks? Are you using powershell to execute the generators?

jonesp1 commented 3 weeks ago

Yes here is the report; I am running Windows, and using Bash to run the script, and the NX console to run the generator, I tried both

Report complete - copy this into the issue template

Node : 20.11.1 OS : linux-x64 pnpm : 9.0.6

nx (global) : 18.3.4 nx : 19.2.3 @nx/js : 19.2.3 @nx/jest : 19.2.3 @nx/linter : 19.2.3 @nx/eslint : 19.2.3 @nx/workspace : 19.2.3 @nrwl/workspace : 17.2.0 @nx/devkit : 19.2.3 @nrwl/devkit : 17.2.8 @nx/esbuild : 19.2.3 @nx/node : 19.2.3 @nx/playwright : 19.2.3 @nx/plugin : 19.2.3 @nx/react : 19.2.3 @nrwl/tao : 19.2.3 @nx/vite : 19.2.3 @nx/web : 19.2.3 @nx/webpack : 19.2.3 typescript : 5.4.5

Registered Plugins: @nx/vite/plugin @nx/playwright/plugin

Community plugins: @nx-aws-plugin/nx-aws-cache : 3.2.1 @nx-extend/pulumi : 6.2.0

Local workspace plugins: @wats-nx

The following packages should match the installed version of nx

To fix this, run nx migrate nx@19.2.3

MaxKless commented 3 weeks ago

Thanks for the nx report. I mean when you use Nx Console to run the generator, which terminal is it run in? Is it bash? You can look at the shell being used by hovering over the side in VSCode

image

You can read more about the integrated terminals here and on how to configure bash or cmd or powershell. RIght now we are aware of a bug with using powershell https://code.visualstudio.com/docs/terminal/profiles

jonesp1 commented 3 weeks ago

Yes it is bash I run it in

ffMathy commented 2 weeks ago

Looks like this is duplicated of https://github.com/nrwl/nx/issues/26470, which may contain more useful information.

MaxKless commented 2 weeks ago

Thanks @ffMathy! I'll close this as a duplicate.