qwik icon indicating copy to clipboard operation
qwik copied to clipboard

`Cannot find package 'vite'` (when using pnpm)

Open vjpr opened this issue 3 years ago • 5 comments
trafficstars

Qwik Version

0.0.39

Operating System (or Browser)

macOS

Node Version (if applicable)

18.3

Which component is affected?

Starters / CLI

Expected Behaviour

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite' imported from /xxx/node_modules/.pnpm/@[email protected]/node_modules/@builder.io/qwik/optimizer.mjs
    at new NodeError (node:internal/errors:377:5)
    at packageResolve (node:internal/modules/esm/resolve:910:9)
    at moduleResolve (node:internal/modules/esm/resolve:959:20)
    at defaultResolve (node:internal/modules/esm/resolve:1174:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:605:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:18)
    at ESMLoader.import (node:internal/modules/esm/loader:404:22)
    at importModuleDynamically (node:internal/modules/esm/translators:106:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
    at sys.strictDynamicImport.sys.dynamicImport (file:///xxx/node_modules/.pnpm/@[email protected]/node_modules/@builder.io/qwik/optimizer.mjs:501:57)

Actual Behaviour

No error.

Additional Information

Relies on hoisting. @builder.io/qwik should depend explicitly on vite as a peer dep.

vjpr avatar Aug 09 '22 14:08 vjpr

can you submit a PR?

manucorporat avatar Aug 12 '22 11:08 manucorporat

@vjpr May I ask how have you dealt with this? Pulling hairs right now

stereokai avatar Oct 15 '22 17:10 stereokai

https://pnpm.io/package_json#pnpmpackageextensions

See additional info above for the deps to add.

vjpr avatar Oct 15 '22 17:10 vjpr

Thank you very much! My problem is that vite is installed, but one of its plugins can't find it o.0

stereokai avatar Oct 15 '22 17:10 stereokai

Hi @vjpr Gave it a spin with 0.12.0 and didn't discover any issue like this. Do you still have any issues or could this be closed?

zanettin avatar Oct 29 '22 12:10 zanettin

@vjpr did you have time to dbl check it on your end? i'd suggest to close the issue by now and create a new one if needed? cc @shairez 🙏

zanettin avatar Nov 24 '22 22:11 zanettin

yeah I think pnpm works now seamlessly

thanks for the ping (and triaging) @zanettin closing

@vjpr feel free to reopen / recreate if it happens again thanks for the report!

shairez avatar Nov 29 '22 23:11 shairez