Repository navigation
Description
Describe the bug
When a server component is called with POST and single-flight collects data, the frame-stream response has X-Frame-Stream: "" and its primary frame has "id": "". On the client, applyFlightResponse returns rootId ? binding : envelope.value. With an empty root id it returns envelope.value, which is undefined for a component result, so a dynamic() over the call renders nothing: no fallback, no content, no error.
The cause is packaging. packages/web/frames/src/frame-sink.ts imports getEventServerFunctionInvocation from ../../server-functions/src/server.js by relative path, so frames/dist/server.js bundles its own copy of that module. The shared registries in that copy go through processState(...) on globalThis, but INVOCATIONS is const INVOCATIONS = new WeakMap() (server.ts:1102 on next). The handler records the invocation in the server-functions copy, and frameTransformFlightResult reads the frames copy, which is always empty.
Any app that registers a flight-data source hits this on every POST server component call. That includes @solidjs/router's createFlightDataCollector and TanStack Start's tsr source. Components fetched with GET (for example through query()) aren't affected, because single-flight only applies to POST.
Steps to Reproduce the Bug or Issue
With @solidjs/[email protected] and [email protected]:
import { configureServerFunctionsServer, handleServerFunctionRequest, registerServerReference, createServerReference } from "@solidjs/web/server-functions/server";
import { frameTransformResult, frameTransformDirectResult, frameTransformFlightResult, FRAME_STREAM_HEADER } from "@solidjs/web/frames/server";
import { provideRequestEvent } from "@solidjs/web/storage";
createServerReference(registerServerReference("view-1", async () => () => "view markup"));
configureServerFunctionsServer({
provideEvent: provideRequestEvent,
transformResult: frameTransformResult,
transformDirectResult: frameTransformDirectResult,
transformFlightResult: frameTransformFlightResult,
collectFlightData: async () => ({ "route-data[]": { title: "x" } })
});
const res = await handleServerFunctionRequest(
new Request("http://localhost/_server/data/view-1", {
method: "POST",
headers: { "content-type": "application/json", origin: "http://localhost", "sec-fetch-site": "same-origin", "x-server-function-format": "3", "x-single-flight": "true" },
body: "[]"
})
);
console.log(FRAME_STREAM_HEADER + ":", JSON.stringify(res.headers.get(FRAME_STREAM_HEADER)));It prints X-Frame-Stream: "". Calling getEventServerFunctionInvocation(event) from @solidjs/web/server-functions/server inside a wrapping transformFlightResult returns {"id":"view-1"} for the same event, which shows the two copies disagree.
Expected behavior
X-Frame-Stream: "view-1", so the client binds the returned component. Changing the declaration to const INVOCATIONS = processState("solid.ServerFunctionInvocations", () => new WeakMap()) in the server-functions and frames server bundles (all three flavors) makes the script print "view-1". It also fixes the blank render in a TanStack Start app that calls a server component client-first in production.
Platform
- OS: macOS 15 (Darwin 24.3.0)
- Versions:
@solidjs/[email protected],[email protected], Node 24.21.0. Still reproduces with@solidjs/webbuilt fromnextat cf22713 (after the Single-flight with server components fails:frameTransformFlightResultdoes not read consumer-keyed flight data #3638 fix): the script printsX-Frame-Stream: "", andframe-transport.tsstill returnsrootId ? binding : envelope.value.
Activity
fix(web): frames server build shares one server-functions instance; X…
ryansolid commentedon Sep 24, 2026