Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vite] cannot find entry point module ... error when a runner full reloads with a virtual module entry #19283

Open
7 tasks done
hi-ogawa opened this issue Jan 24, 2025 · 0 comments

Comments

@hi-ogawa
Copy link
Collaborator

Describe the bug

I found the issue when migrating to environment API on hi-ogawa/vite-plugins#669. Minimal reproduction looks like this:

// virtual:entry
import hello from "/src/hello.js";

// repro.js
await server.environments.ssr.runner.import("virtual:entry");
await new Promise((r) => setTimeout(r, 1000)); // need to wait a bit
fs.writeFileSync("src/hello.js", `export default "hello-${Date.now()}"\n`);
// == logs ==
// [vite] program reload
// [vite] An error happened during full reload
// [vite] cannot find entry point module 'virtual:entry'.

Reproduction

https://stackblitz.com/github/hi-ogawa/reproductions/tree/main/vite-plugins-669-runner-reload-virtual-entry?file=README.md

Steps to reproduce

open stackblitz and run repro.js

 node repro.js
[vite] connected.
>>> importing 'virtual:entry' { hello: 'hello-1737703880751' }
>>> editing 'src/hello.js'
4:54:38 PM [vite] (ssr) page reload src/hello.js
[vite] program reload
[vite] An error happened during full reload
[vite] cannot find entry point module 'virtual:entry'.
Error: [vite] cannot find entry point module 'virtual:entry'.
    at fetchModule (file:///home/projects/qgnirlwavy.github/node_modules/.pnpm/vite@6.0.11/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:51715:13)
    at async handleInvoke (file:///home/projects/qgnirlwavy.github/node_modules/.pnpm/vite@6.0.11/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:44403:22)
    at async EventEmitter.listenerForInvokeHandler (file:///home/projects/qgnirlwavy.github/node_modules/.pnpm/vite@6.0.11/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:44476:19)
>>> importing 'virtual:entry' { hello: 'hello-1737705278383' }

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    vite: ^6.0.11 => 6.0.11

Used Package Manager

npm

Logs

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant