vite cannot support yarn2 Global Cache
See original GitHub issueDescribe the bug
when i use yarn berry and set enableGlobalCache: true
.
i got an error look’s like this:
X [ERROR] Could not resolve "./C:/Users/<User Name>/AppData/Local/Yarn/Berry/cache/<Package>.zip/node_modules/<Path to>.js"
it’s maybe an esbuild bug.
Reproduction
https://github.com/frg2089/vite-bug
System Info
Need to install the following packages:
envinfo
Ok to proceed? (y) y
System:
OS: Windows 10 10.0.25140
CPU: (8) x64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 5.53 GB / 17.94 GB
Binaries:
Node: 18.2.0 - D:\Program Files\nodejs\node.EXE
Yarn: 4.0.0-rc.6 - D:\Program Files\nodejs\yarn.CMD
npm: 8.11.0 - D:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.25140.1000.0), Chromium (103.0.1264.44)
Internet Explorer: 11.0.25140.1000
Used Package Manager
yarn
Logs
Click to expand!
placeholder | sample |
---|---|
<Path To Local Appdata> |
%LOCALAPPDATA% |
<Path To Project> |
e.g. D:\Repos\vite-demo |
vite v2.9.13 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 523ms.
✘ [ERROR] Could not resolve "./<Path To Local Appdata>/Yarn/Berry/cache/@microsoft-fast-components-npm-2.30.6-d634ccef7f-7.zip/node_modules/@microsoft/fast-components/dist/esm/index.js"
dep:@microsoft_fast-components:2:14:
2 │ export * from "./<Path To Local Appdata>/Yarn/Berry/cache/@microsoft-fast-components-npm-2.30.6-d...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
09:25:02 [vite] error while updating dependencies:
Error: Build failed with 1 error:
dep:@microsoft_fast-components:2:14: ERROR: Could not resolve "./<Path To Local Appdata>/Yarn/Berry/cache/@microsoft-fast-components-npm-2.30.6-d634ccef7f-7.zip/node_modules/@microsoft/fast-components/dist/esm/index.js"
at failureErrorWithLog (<Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:1605:15)
at <Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:1251:28
at runOnEndCallbacks (<Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:1034:63)
at buildResponseToResult (<Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:1249:7)
at <Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:1358:14
at <Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:666:9
at handleIncomingPacket (<Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:763:9)
at Socket.readFromStdout (<Path To Project>\vite-bug\.yarn\unplugged\esbuild-npm-0.14.48-d0430cb883\node_modules\esbuild\lib\main.js:632:7)
at Socket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:324:12)
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Yarn 3.1, Vite 2.9, cannot find package vite - Stack Overflow
When trying to build the app with Vite I'm seeing an error. ... import vite-virtual-ec56a6c02a/0/cache/vite-npm-2.9.13-cda1bb45b9-a5e501b920 ...
Read more >Yarn caching doesn't work - Visual Studio Feedback
I'm trying to cache my yarn node_modules and following the examples in the documentation, I'm unable to get it work, it always gives...
Read more >[AskJS] Is someone using Yarn v2 in business? - Reddit
Zero-Installs represents committing the .yarn/cache folder to a repository (It's ... Yarn 2 currently supports only 4 lifecycle scripts:.
Read more >Heroku Node.js Support
This cache is used to store caches for npm, yarn, and bower. You can disable all caching for Node.js apps if you prefer:...
Read more >Plug'n'Play | Yarn - Package Manager
Native support; Support via plugins; Incompatible ... we still ended up unable to optimize some particular patterns - causing not only the disk...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing as lack of response and I guess this is a duplicate of #4635
@HasanMothaffar Would you test if moving global cache to the same drive works?
yarn config set cache-folder <path>
is the command, I suppose. https://classic.yarnpkg.com/en/docs/cli/cache#toc-change-the-cache-path-for-yarn