QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.45k stars 1.26k forks source link

[🐞] Error with Yarn PnP when Vite is type: module #5582

Closed yvvki closed 1 day ago

yvvki commented 6 months ago

Which component is affected?

Qwik Rollup / Vite plugin

Describe the bug

Following the guide at https://qwik.builder.io/docs/getting-started/ and running the script:

yarn qwik add static

I am able to use Qwik with Vite.


The generated Vite configuration is the type CommonJS since package.json does not include the keyword "type": "module". However, this causes building the project a warning:

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

Upon changing the Vite configuration to type: module, either by renaming vite.config.ts to vite.config.mts or specifying "type": "module" in the package.json. Running yarn build gave me this output:

Terminal output ``` vite v5.0.8 building for production... thread '' panicked at 'called `Result::unwrap()` on an `Err` value: Opening $MyLocalAppData$\Yarn\Berry\cache\@builder.io-qwik-city-npm-1.3.0-70d44bc358-10c0.zip\node_modules\@builder.io\qwik-city\index.qwik.mjs Caused by: The system cannot find the path specified. (os error 3)', packages\qwik\src\napi\src\lib.rs:21:50 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace βœ“ 0 modules transformed. [vite-plugin-qwik] called `Result::unwrap()` on an `Err` value: Opening $MyLocalAppData$\Yarn\Berry\cache\@builder.io-qwik-city-npm-1.3.0-70d44bc358-10c0.zip\node_modules\@builder.io\qwik-city\index.qwik.mjs Caused by: The system cannot find the path specified. (os error 3) error during build: Error: called `Result::unwrap()` on an `Err` value: Opening $MyLocalAppData$\Yarn\Berry\cache\@builder.io-qwik-city-npm-1.3.0-70d44bc358-10c0.zip\node_modules\@builder.io\qwik-city\index.qwik.mjs Caused by: The system cannot find the path specified. (os error 3) at transformFsAsync (file:///$MyProjectDir$/.yarn/unplugged/@builder.io-qwik-virtual-cb69891d7f/node_modules/@builder.io/qwik/optimizer.mjs:1408:20) at Object.transformFs (file:///$MyProjectDir$/.yarn/unplugged/@builder.io-qwik-virtual-cb69891d7f/node_modules/@builder.io/qwik/optimizer.mjs:1390:32) at Object.buildStart (file:///$MyProjectDir$/.yarn/unplugged/@builder.io-qwik-virtual-cb69891d7f/node_modules/@builder.io/qwik/optimizer.mjs:1926:38) at Object.buildStart (file:///$MyProjectDir$/.yarn/unplugged/@builder.io-qwik-virtual-cb69891d7f/node_modules/@builder.io/qwik/optimizer.mjs:3469:24) at async Promise.all (index 3) at async PluginDriver.hookParallel (file:///$MyLocalAppData$/Yarn/Berry/cache/rollup-npm-4.9.0-8c6d128a25-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:18565:9) at async file:///$MyLocalAppData$/Yarn/Berry/cache/rollup-npm-4.9.0-8c6d128a25-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:19467:13 at async catchUnfinishedHookActions (file:///$MyLocalAppData$/Yarn/Berry/cache/rollup-npm-4.9.0-8c6d128a25-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:18981:16) at async rollupInternal (file:///$MyLocalAppData$/Yarn/Berry/cache/rollup-npm-4.9.0-8c6d128a25-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:19464:5) at async build (file:///$MyProjectDir$/.yarn/__virtual__/vite-virtual-7168a4a7b0/3/Profiles/Ryyvv/AppData/Local/Yarn/Berry/cache/vite-npm-5.0.8-7f71954365-10c0.zip/node_modules/vite/dist/node/chunks/dep-uAHLeuC6.js:66760:18) ```

Reproduction

https://github.com/yvvki/Typ/tree/bug

Steps to reproduce

yarn install && yarn build

System Info

System:

Binaries:

Browsers:

Additional Information

No response

gioboa commented 2 weeks ago

I tested with the latest version of Qwik and it's working, is it working for you @yvvki ?

github-actions[bot] commented 2 weeks ago

Hello @yvvki. Please provide the missing information requested above. Issues marked with STATUS-2: missing info will be automatically closed if they have no activity within 14 days. Thanks πŸ™