Closed shairez closed 1 year ago
For some reason ensurePackage
function doesn't add packages when used within create-nx-workspace
On macOS 10.15.6 it fails with the following
> NX Cannot find module '@nxkit/playwright'
Require stack:
- /Users/dmitriy/projects/test/cuterepo/node_modules/qwik-nx/src/generators/application/lib/add-e2e-project.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/qwik-nx/src/generators/application/generator.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/qwik-nx/src/generators/preset/generator.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/config/workspaces.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/config/configuration.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/command-line/generate.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/command-line/nx-commands.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/nx/bin/init-local.js
- /Users/dmitriy/projects/test/cuterepo/node_modules/nx/bin/nx.js
Pass --verbose to see the stacktrace.
> NX Failed to apply preset: qwik-nx
On macOS 10.15.6 it fails with the following
> NX Cannot find module '@nxkit/playwright' Require stack: - /Users/dmitriy/projects/test/cuterepo/node_modules/qwik-nx/src/generators/application/lib/add-e2e-project.js - /Users/dmitriy/projects/test/cuterepo/node_modules/qwik-nx/src/generators/application/generator.js - /Users/dmitriy/projects/test/cuterepo/node_modules/qwik-nx/src/generators/preset/generator.js - /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/config/workspaces.js - /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/config/configuration.js - /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/command-line/generate.js - /Users/dmitriy/projects/test/cuterepo/node_modules/nx/src/command-line/nx-commands.js - /Users/dmitriy/projects/test/cuterepo/node_modules/nx/bin/init-local.js - /Users/dmitriy/projects/test/cuterepo/node_modules/nx/bin/nx.js Pass --verbose to see the stacktrace. > NX Failed to apply preset: qwik-nx
I'm seeing the same error ... This is what I have
node v16.19.0 create-nx-workspace@15.6.3
@giri-jeedigunta as a workaround for now you can use npx create-nx-workspace --preset qwik-nx --e2eTestRunner=none
.
@giri-jeedigunta as a workaround for now you can use
npx create-nx-workspace --preset qwik-nx --e2eTestRunner=none
.
This works !!! I'm able to move forward
The error appears with just the app generator in a fresh Nx workspace as well. At least for me some minutes ago. So maybe not a preset issue alone
@DominikPieper can you please provide error logs or reproduction steps (along with versions/environment you are using)? I don't see any issues with app generator as of now
@dmitry-stepanenko If I call the generator twice, the second call works as expected. I'll take a deeper look later
Steps:
npx create-nx-workspace@latest nx-qwik-test (used the integrated scheme)
npm install --save qwik-nx
npx nx g qwik-nx:app app
Logs:
npx nx g qwik-nx:app app --verbose
> NX Generating qwik-nx:application
✔ Which stylesheet format would you like to use? · css
added 1 package, removed 32 packages, and audited 350 packages in 796ms
31 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
> NX Cannot find module '@nxkit/playwright'
Require stack:
- /private/tmp/nx-qwik-test/node_modules/qwik-nx/src/generators/e2e-project/generator.js
- /private/tmp/nx-qwik-test/node_modules/qwik-nx/src/generators/application/generator.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/config/workspaces.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/config/configuration.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/command-line/generate.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/command-line/nx-commands.js
- /private/tmp/nx-qwik-test/node_modules/nx/bin/init-local.js
- /private/tmp/nx-qwik-test/node_modules/nx/bin/nx.js
Error: Cannot find module '@nxkit/playwright'
Require stack:
- /private/tmp/nx-qwik-test/node_modules/qwik-nx/src/generators/e2e-project/generator.js
- /private/tmp/nx-qwik-test/node_modules/qwik-nx/src/generators/application/generator.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/config/workspaces.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/config/configuration.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/command-line/generate.js
- /private/tmp/nx-qwik-test/node_modules/nx/src/command-line/nx-commands.js
- /private/tmp/nx-qwik-test/node_modules/nx/bin/init-local.js
- /private/tmp/nx-qwik-test/node_modules/nx/bin/nx.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
at Module._load (node:internal/modules/cjs/loader:885:27)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (/private/tmp/nx-qwik-test/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at /private/tmp/nx-qwik-test/node_modules/qwik-nx/src/generators/e2e-project/generator.js:35:73
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Nx Report:
npx nx report
> NX Report complete - copy this into the issue template
Node : 18.13.0
OS : darwin x64
npm : 8.19.3
nx : 15.6.3
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 15.6.3
@nrwl/esbuild : Not Found
@nrwl/eslint-plugin-nx : 15.6.3
@nrwl/expo : Not Found
@nrwl/express : Not Found
@nrwl/jest : Not Found
@nrwl/js : 15.6.1
@nrwl/linter : 15.6.3
@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/rollup : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/webpack : Not Found
@nrwl/workspace : 15.6.3
@nrwl/vite : 15.6.1
typescript : 4.8.4
---------------------------------------
Local workspace plugins:
---------------------------------------
Community plugins:
qwik-nx: 0.9.0
@nxkit/playwright: 2.1.0
``
Thank you, @DominikPieper! Will take a look
It seems that this is a bug in the nodejs https://github.com/nodejs/node/issues/44663
At this point it makes sense to adjust third-party package instead of creating workarounds here.
@sebastiandg7 can you please take a look at the fix in your repo please https://github.com/nxkit/nxkit/pull/59 🙏
Thank you! I'm releasing the fix asap. Will it be worth to cover this with e2e tests?
Thanks a lot @sebastiandg7 ! Yes, I will cover this with e2e tests for sure
Just released @nxkit/playwright
v2.1.1 with @dmitry-stepanenko's fix (thanks!). Opened #76 updating our dependency.
Thank you @sebastiandg7 !
this still happens to me even when using npx
Tried to break it into manual steps like @DominikPieper suggested but getting this after running:
npx nx g qwik-nx:preset --verbose
@shairez talked to Giora about the e2e tests at Discord, maybe easier to break down this one after we get tests to cover the preset as well. Easier to test with automation deploy and test cycles
@shairez @dmitry-stepanenko this seems to be a different error breaking the preset generator, but we couldn't get to that point because of the one we just fixed. Seems like the playwright project generator is not getting the name
option passed. Will take a look at that. Can we re open this issue?
@sebastiandg7 this is now fixed https://github.com/qwikifiers/qwik-nx/pull/79. Haven't setup e2e as I know Giora is working on it
Describe the bug
Creating a new workspace with the qwik-nx preset throws (I'm using windows 10)
To Reproduce
Run
pnpx create-nx-workspace --preset qwik-nx
Expected behavior To complete with no errors
Screenshots
Desktop (please complete the following information):