Describe the bug
When a file in a RunnableDevEnvironment changes and has no HMR boundary, Vite sends full-reload to the environment's hot channel. The module runner receives this, clears its cache, and starts re-importing entrypoints. If server.close() is called (e.g. test teardown) while the re-import is in flight, the transport disconnects and logs:
[vite] An error happened during full reload
Error: transport was disconnected, cannot call "fetchModule"
The error is caught and doesn't crash the process — but on slow CI (Windows), the re-import attempt adds latency on every HMR event causing test suites to time out.
Reproduction
https://github.com/ematipico/test-errors/tree/bug/transport
Steps to reproduce
- Checkout the repro
- Checkout the branch
bug/transport
- Run
node repro.mjs
System Info
System:
OS: macOS 26.3.1
CPU: (12) arm64 Apple M4 Pro
Memory: 5.64 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.12.0 - /Users/ema/.nvm/versions/node/v24.12.0/bin/node
npm: 11.6.2 - /Users/ema/.nvm/versions/node/v24.12.0/bin/npm
pnpm: 10.28.0 - /Users/ema/.nvm/versions/node/v24.12.0/bin/pnpm
Browsers:
Firefox: 149.0
Safari: 26.3.1
Used Package Manager
pnpm
Logs
No response
Validations
Describe the bug
When a file in a RunnableDevEnvironment changes and has no HMR boundary, Vite sends full-reload to the environment's hot channel. The module runner receives this, clears its cache, and starts re-importing entrypoints. If server.close() is called (e.g. test teardown) while the re-import is in flight, the transport disconnects and logs:
The error is caught and doesn't crash the process — but on slow CI (Windows), the re-import attempt adds latency on every HMR event causing test suites to time out.
Reproduction
https://github.com/ematipico/test-errors/tree/bug/transport
Steps to reproduce
bug/transportnode repro.mjsSystem Info
System: OS: macOS 26.3.1 CPU: (12) arm64 Apple M4 Pro Memory: 5.64 GB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.12.0 - /Users/ema/.nvm/versions/node/v24.12.0/bin/node npm: 11.6.2 - /Users/ema/.nvm/versions/node/v24.12.0/bin/npm pnpm: 10.28.0 - /Users/ema/.nvm/versions/node/v24.12.0/bin/pnpm Browsers: Firefox: 149.0 Safari: 26.3.1Used Package Manager
pnpm
Logs
No response
Validations