Random empty modules when using `@cloudflare/vite-plugin`
What versions & operating system are you using?
System: OS: Linux 6.8 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat) CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz Memory: 2.85 GB / 7.52 GB Container: Yes Shell: 5.2.21 - /bin/bash Binaries: Node: 22.14.0 - /home/rom/.nvm/versions/node/v22.14.0/bin/node Yarn: 1.22.22 - /home/rom/.nix-profile/bin/yarn npm: 10.9.2 - /home/rom/.nvm/versions/node/v22.14.0/bin/npm pnpm: 10.14.0 - /home/rom/.nvm/versions/node/v22.14.0/bin/pnpm bun: 1.3.4 - /home/rom/.bun/bin/bun Deno: 1.44.4 - /home/rom/.nix-profile/bin/deno Watchman: 2024.03.11.00 - /home/rom/.nix-profile/bin/watchman
Please provide a link to a minimal reproduction
https://github.com/vikejs/vike/issues/2903#issuecomment-3636996346
Describe the Bug
Users are occasionally getting this error when using @cloudflare/vite-plugin. The root cause is that Vike's entry (virtual module) seems to be empty (it doesn't export anything but it normally does). We can't reproduce reliably, it's random and not that frequent.
Please provide any relevant error logs
No response
Hi @brillout! Have you been able to reproduce this without Vike? That would help track down the problem.
It's already tricky to reproduce with Vike (it happens only seldomly and I can't find a path to reliably reproduce it), so I ain't sure how I could try to reproduce it without Vike. We've added some debug logs — let's see how often users report the error and if something interesting comes out from the debug logs.
Note that it also occurs without Photon. (Using the the user-land Vike + @cloudflare/vite-plugin integration I mentioned a while ago and that we use for Vike's CI.)
(AFAICT it's the only paper cut left! I'm working on a fix for the two other issues I mentioned on Discord.)