Skip to content

[v8] RunnableDevEnvironment: "transport was disconnected, cannot call fetchModule" logged when server closes during full-reload re-import #22011

@ematipico

Description

@ematipico

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

  1. Checkout the repro
  2. Checkout the branch bug/transport
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-downstream-blockerBlocking the downstream ecosystem to work properly (priority)

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions