The file does not exist at "node_modules/.vite/deps/chunk*" which is in the optimize deps directory.
#17738
Replies: 31 comments 19 replies
-
Just seemingly randomly started getting the same (with sveltekit). I already completely nuked and reinstalled |
Beta Was this translation helpful? Give feedback.
-
Clearing cache on the browser fixes it! Strange. Since I've never seen this before and it seems like there is a sudden influx of reports of this recently, I wonder if it's a regression on vite or some other common package. |
Beta Was this translation helpful? Give feedback.
-
Same here. This bug seems to happen when I use dynamic import on local development server. As workaround, I'm trying the 2 ways below. It's gonna happen soon again tho.
|
Beta Was this translation helpful? Give feedback.
-
Blowing away my node_modules and re-running |
Beta Was this translation helpful? Give feedback.
-
Same issue here, removing /node_modules/.vite and npm install solves it until next build or |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Very annoying. |
Beta Was this translation helpful? Give feedback.
-
Has anyone stepped back versions to see when it started happening? |
Beta Was this translation helpful? Give feedback.
-
I'm facing the same problem, run |
Beta Was this translation helpful? Give feedback.
-
We are also running into this issue seemingly at random |
Beta Was this translation helpful? Give feedback.
-
Adding this to my vite config seems to help with the issue but, I'm sure I understand the full implications |
Beta Was this translation helpful? Give feedback.
-
I also faced the same problem. Vite says it can not find a dependency that is in another project! |
Beta Was this translation helpful? Give feedback.
-
Experiencing the same issue in my SvelteKit app. Resolved by clearing cache and node_modules. Thanks @efstajas |
Beta Was this translation helpful? Give feedback.
-
Same happening randomly when switching between branches with slightly different dependencies |
Beta Was this translation helpful? Give feedback.
-
Same issue here, it started after upgrading from Angular v17 to 18.2.0, which comes with a new version of Vite I guess. We work in a monorepo where there is a component library and an app project using the components. Whenever I create a new file that is exported, or change branches without said new files, the bug appears and the web app refuses to load. Can be temporarily fixed by clearing npm and angular cache, or by disabling caching in the browser. But the moment a file changes, the error comes back. |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Just started randomly out of nowhere. Deleting node_modules/.vite fixes it for me until it rises again. UPD: So it happens mostly when I switch branches with different packages installed. Most of the time vite says:
|
Beta Was this translation helpful? Give feedback.
-
I have seen this many times lately, after lots of dependency updates.
but then after some times it comes again, and then I just change to
and restart the dev-server, and then it is ok again. |
Beta Was this translation helpful? Give feedback.
-
This is still happening, so far clearing the browser cache fixes it immediately? |
Beta Was this translation helpful? Give feedback.
-
Same issue. I updated a large number of dependencies and this problem started happening each time I restarted the dev server. Reloading the page with "disable cache" fixed the problem for me. I'm using Vite |
Beta Was this translation helpful? Give feedback.
-
I just started getting this today out of nowhere, without touching anything in my lock file. It's now happening literally every few minutes, the only way to fix this is wiping out |
Beta Was this translation helpful? Give feedback.
-
We are currently experiencing this with vite |
Beta Was this translation helpful? Give feedback.
-
This happens to me every time I restart my app after switching branches. It's become quite the headache. |
Beta Was this translation helpful? Give feedback.
-
the same with me. I check the following solution. optimizeDeps: {
exclude: [".vite"],
}, optimizeDeps: {
force: true,
}, Who knows a better option rather than these or can tell which one from these is better? |
Beta Was this translation helpful? Give feedback.
-
Same issue when using firestore emulator and swtiching branches. every stopping the emulator and restarting causes it even if you are in the same branch the whole time. |
Beta Was this translation helpful? Give feedback.
-
Same issue and I fix with |
Beta Was this translation helpful? Give feedback.
-
If none of these solutions won't work for you just close IDE/Code Editor that use this project, go in in .angular folder from your project, delete the cache folder, open again in IDE/Code Editor and run it again! It worked for me! |
Beta Was this translation helpful? Give feedback.
-
removed .vite folder from node_modules , then restarted , worked for me . |
Beta Was this translation helpful? Give feedback.
-
I face this problem randomly, one day, every time I start the project I face this error and I have to remove .vite folder manually. I am looking for better solution, But this error: |
Beta Was this translation helpful? Give feedback.
-
I am also facing this, currently on VITE Unfortunately none of the above listed fixes it reliably. So it's super annoying. I am wondering why I can not find an issue on that & if the vite team is actually aware of of it. |
Beta Was this translation helpful? Give feedback.
-
I've bumped into this issue as well after updating to Vite 5.4.10 |
Beta Was this translation helpful? Give feedback.
-
my disable cache option was already checked. But unchecking and checking that again and then clearing the cache of browser worked for me . |
Beta Was this translation helpful? Give feedback.
-
I'm getting the following message, sometimes, seemingly only after HMR happens a few times:
I haven't been able to find any cause, but as far as I can tell, it didn't result from adding any package, as I haven't done so in a while. It also doesn't happen always, and seemingly only starts happening after HMR, but not after every HMR (HMR as also been really slow)
There's a similar discussion in storybookjs/storybook#28542 but I'm not using storybook
Note: Since I haven't been able to create a minimal reproduction, I can't post this as a bug report
This makes some sense, but I have no idea how I would go about reducing this, tbh...
Beta Was this translation helpful? Give feedback.
All reactions