fix(dev): use the websocket adapter of the runtime the dev worker runs in - #4711
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 3, 2026
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (7)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
pi0
approved these changes
Oct 3, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebSockets in dev only worked on Node: both dev entries (
nitro devand the Vite dev worker) importedcrossws/adapters/nodedirectly, so running underbun --buncrashed with[crossws] Using Node.js adapter in an incompatible environment.The dev entries now export crossws
{ resolve }options through env-runner'swebsocketentry field, and env-runner installs the adapter of the runtime the worker actually runs in. The Vite worker entry only declares it whenfeatures.websocketis enabled, and resolving hooks now waits for the app entry, which also fixes a WebSocket sent as the very first request failing on Node.test/vite/websocket.test.tsstarts real dev servers in a child process and echoes over a WebSocket for Vite dev andnitro dev, under Node andbun --bun. Three of the four cases fail onmain(nitro devon Node already worked).nitro devunder Deno was checked by hand.Combines #4376 and #4597. The parent dev server WebSocket proxy and the hook caching from #4376 are not needed: current Bun proxies the upgrade through
node:httpfine, and crossws 0.4.12 already caches resolved hooks per connection.Fixes #3939
🤖 Generated with AI assistant