fix: hand h3 a standard ReadableStream in dev#2206
Open
brenelz wants to merge 1 commit into
Open
Conversation
The dev path returned the raw Solid stream object ({ pipe, pipeTo })
from renderToStream. That only renders on Node by accident: srvx's
NodeResponse duck-types `.pipe` on the body. Under Bun and Deno, srvx's
FastResponse is the native Response, which coerces the object to the
literal string "[object Object]" - a blank page. Always pipe through a
TransformStream like the production path so h3 receives a standard web
ReadableStream on every runtime.
The special case guarded against a dev-server crash when a stream was
cancelled mid-flight; that no longer reproduces (solid-js's pipeTo
catches every write/close since 1.9), verified by aborting requests
mid-stream under both node and bun with a slow Suspense boundary.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 147fdb6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
birkskyum
approved these changes
Jul 17, 2026
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.
Fixes #2133
What is the current behavior?
In dev, the handler returns the raw Solid stream object (
{ pipe, pipeTo }) fromrenderToStream. That only renders on Node by accident: h3 falls through tonew FastResponse(body), and srvx's Node adapter duck-types.pipeon the body. Under Bun and Deno, srvx'sFastResponseis the nativeResponse, which coerces the unknown object viatoString()— the whole page body becomes the literal string[object Object].Reproduced with
bun --bun run devon 2.0.0-beta.2 and verified the mechanism (srvx bun adapter loads, handler takes thereturn streambranch). On beta.3+ the bug is currently masked by #2183 addingh3tossr.noExternal(Vite's module runner then resolves srvx with node conditions even under bun) — this PR makes the behavior correct by contract instead of by accident.What is the new behavior?
Dev uses the same path as production: pipe through a
TransformStreamand return a standard webReadableStream, which every srvx adapter handles. Verified under bun (bun --bun run vite dev) — correct streamed HTML — and under node.Other information
The removed special case guarded against a dev-server crash when a stream was cancelled mid-flight (from the Devinxi migration, #1942). That no longer reproduces: solid-js ≥1.9's
pipeTocatches every write/close, and aborting curl mid-stream with a 5s Suspense boundary under both node and bun leaves the dev server healthy and serving subsequent requests.Same conclusion as @GregorLohaus's closed #2134, minus the hardcoded
content-typeheader (already set on the event response bycreatePageEvent) and without keeping a dev/prod divergence. Also related: #2145/#2148/#2163 (same symptom via the deprecated nitro-v2 plugin).globalThis.USING_SOLID_START_DEV_SERVERnow has no remaining readers; left in place to keep this diff minimal.Full playwright e2e suite in
apps/tests(which runs againstvite devand exercises this branch) passes.🤖 Generated with Claude Code