#11063 Vite plugin fails with vite-plugin-vue-devtools and remote bindings enabled
Confirmed race condition in Vite Hot Channel initialization. Maintainer investigated, created reproduction repo. Affects multiple third-party plugins using hot.send().
Keep tracking - awaiting fix to queue messages before WebSocket connected.
Analysis Report
Issue Review: cloudflare/workers-sdk#11063
Summary
Vite plugin crashes with "The WebSocket is undefined" assertion error when using vite-plugin-vue-devtools and remote D1 bindings together.
Findings
- Created: 2025-10-22
- Updated: 2025-11-07
- Version: @cloudflare/vite-plugin 1.13.14 → 1.21.2 (current)
- Component: @cloudflare/vite-plugin (vite-plugin)
- Labels: bug, vite-plugin
- Comments: 2
Key Evidence
Root cause identified by maintainer: Pete Bacon Darwin investigated and identified the issue as a race condition between the Hot Channel feature. Both
vite-plugin-vue-devtoolsand@cloudflare/vite-pluginuse Vite's Hot Channel. TheinitRunner()function (which sets up the WebSocket) is called before the CF plugin accesses the hot channel, butvite-plugin-vue-devtoolsaccesses the hot channel early beforeinitRunneris called.Additional plugin affected: Another user reported that
vite-plugin-inspecthas the same issue, also usinghot.sendto send custom messages.Condition: The issue occurs more frequently when remote bindings are enabled because
initRunner()takes longer in that case. Without remote bindings, the timing issue is less likely to surface.Suggested fix from community: A user suggested queueing incoming messages before the WebSocket is connected and sending them afterwards.
No fix found:
- No merged PRs explicitly reference fixing this issue (#11063)
- Changelog does not mention issue #11063
- No related WebSocket/hot channel fixes found in recent changelog entries
Reproduction repo exists: Maintainer created https://github.com/petebacondarwin/dark-rice-3c58 to debug the issue
Recommendation
Status: KEEP OPEN
Reasoning: This is a confirmed bug with a known root cause (race condition in Vite's Hot Channel initialization timing). A maintainer has investigated and reproduced the issue. No fix has been merged yet, and the bug affects multiple third-party plugins (vue-devtools, vite-plugin-inspect) that use Vite's hot.send() feature when combined with remote bindings.
Action: Keep tracking until a fix is implemented. The suggested solution of queueing messages before the WebSocket is connected appears viable.
Suggested Comment
N/A - Issue should remain open as a valid bug awaiting a fix.
Notes & Feedback (0)
No notes yet.