You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d9fdfe3
Browse filesBrowse the repository at this point in the historyBrowse files
SSR render failures reach the client sanitized (#3468): the wire policy the server-function handler has applied since #3113/#3116 now covers every SSR road a failure takes — the error an `<Errored>` serializes for hydration, a rejected async source serialized into the stream, a `<Loading>` fragment's `_fr` rejection, a frame stream's error chunks (the fragment's, a live hole's, the root's). Outside the dev build a plain thrown value is replaced with a generic `Error` (`"Internal Server Error"`); `message`, `cause` and own properties stay on the server. A `"use server"` function called in-process during SSR never touches the RPC wire, so before this the production page load shipped what that wire withholds.
8
+
9
+
-**`solid-js`** (server): `<Errored>` sanitizes _before_ rendering its fallback and serializes the same replacement, so fallback markup and the hydration record agree. A fallback printing `err().message` shows the generic message in production, as for a server-function failure. `markSafeError` (`Symbol.for("solid.SafeError")`) passes through with own properties; an Error reached as a _value_ is data and passes as written (#3113's ruling). One replacement per original, however many roads it takes. New finding `SSR_ERROR_SANITIZED` (`info`, observe + dev; `data.error` the original), beside `SSR_RENDER_ERROR_CONTAINED` which carries the failure itself. `ssrSanitizeError` is exposed to the runtimes through `solid-js/internal`. Server findings now carry their `ownerPath` in the **observe** artifact too — the core's walk reads `_parent` under its own build's property mangling and found nothing on a server owner there, so the server entry locates its findings itself.
10
+
-**`@solidjs/web`** (server): the hydration serialize funnel guards every channel it writes (a promise's rejection, an async iterable's thrown step); a fragment's terminal error reaches the `_fr` rejection and a transport sink's error chunk sanitized while the abandonment ledger keeps the original; the frame sink's root error chunk and the live-hole/live-attribute error chunks carry the replacement's message.
11
+
-**`@solidjs/signals`**: the `SSR_ERROR_SANITIZED` code.
12
+
13
+
The dev/prod line is the build variant: the `development` server artifacts keep full fidelity; production and observe sanitize.
Copy file name to clipboardExpand all lines: documentation/solid-2.0/08-dev-diagnostics.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -486,6 +486,12 @@ Finding (`error`, observe + dev) plus the existing behavior: the dev build **thr
486
486
487
487
Finding (`error`, observe + dev). A server function threw and the non-dev wire replaced the error with the generic message (RFC 10's sanitization). The client sees the replacement; this record carries the original in `data.error`. Beside the invocation channel's `outcome: "error"` it is the one place the real failure surfaces in production. A value branded with `markSafeError` passes through and is not reported.
488
488
489
+
#### `SSR_ERROR_SANITIZED`
490
+
491
+
**Message:** "[SSR_ERROR_SANITIZED] Render error replaced with a generic Error before reaching the client: TypeError: …"
492
+
493
+
Finding (`info`, observe + dev; channel only). A render failure was about to reach the client through one of SSR's roads — the record an `<Errored>` serializes so the client hydrates the same fallback, a rejected async source serialized into the stream, a `<Loading>` fragment's `_fr` rejection, a frame stream's error chunk (the fragment's, a live hole's, the root's) — and the non-dev wire replaced it with the generic `Error` (`"Internal Server Error"`), the same policy the server-function wire applies (`SERVER_FN_ERROR_SANITIZED`; a `"use server"` function called in-process during SSR never touches that wire, so before this the page load leaked what the RPC withheld — [#3468](https://github.com/solidjs/solid/issues/3468)). The boundary sanitizes _before_ rendering its fallback and serializes the same replacement, so fallback markup and record agree on hydration. Advisory because the failure itself is the `SSR_RENDER_ERROR_CONTAINED` finding's, which carries the original; this is the record of what the wire carried instead, `data.error` the original, once per original however many roads it took. A value branded with `markSafeError` passes through and is not reported; an Error reached as a _value_ — never thrown — is data and passes as the author wrote it (#3113's ruling). The dev build keeps full fidelity.
494
+
489
495
#### `FRAME_MARKER_CORRUPTED`
490
496
491
497
**Message:** "[FRAME_MARKER_CORRUPTED] Frame slot range "comment#0" is missing its end marker (<!--slot:comment#0:end-->) among its start marker's siblings. …"
Copy file name to clipboardExpand all lines: documentation/solid-2.0/10-server-functions.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,8 @@ Two ways to send intentional error content in production:
113
113
114
114
Framework error hooks compose the same way: a `wrapInvocation`/`transformResult` override that maps a thrown error expresses intent by throwing an envelope or branding its replacement with `markSafeError` — core never second-guesses a branded value, and never trusts an unbranded one.
115
115
116
+
The same policy covers the SSR roads a failure takes to the client — an `<Errored>` record, a rejected async source in the stream, a fragment's rejection, a frame's error chunks — so a `"use server"` function called in-process during a render (which never touches this handler) cannot ship on the page what the RPC wire withholds; see [RFC 12](12-ssr-http.md#what-a-render-failure-looks-like-from-the-client) and `SSR_ERROR_SANITIZED` in [RFC 08](08-dev-diagnostics.md#ssr_error_sanitized). `markSafeError` is the one brand on both.
117
+
116
118
### Single-flight
117
119
118
120
The protocol folds integration data (typically revalidated route data) into a mutation’s response, saving a round trip. Core standardizes only the wire shape and delivery; what the data _is_ — a data-only render, route preloads, a cache query — is entirely the integration’s business.
Copy file name to clipboardExpand all lines: documentation/solid-2.0/12-ssr-http.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,14 @@ Under streaming this implies the natural constraint: status and headers must be
134
134
135
135
Said plainly, `httpHeader` is a **shell-time API**. Headers declared by streamed route content — anything below a `<Loading>` boundary that resolves after the shell went out — run post-flush and are committed no-ops by contract. There is no queue that holds them for a later response; the head is on the wire. If a header matters, it belongs to the shell (or to a `deferStream`-held source that keeps the shell waiting for it).
136
136
137
+
### What a render failure looks like from the client
138
+
139
+
A render failure reaches the client on several roads: the error an `<Errored>` caught, serialized so the client hydrates the same fallback; a rejected async source serialized into the stream; a `<Loading>` fragment rejecting its `_fr` promise; a frame stream's error chunks. On every one of them the **non-dev** build hands the client a generic `Error` (`"Internal Server Error"`) in place of a plain thrown value — `message`, `cause` and own properties stay on the server — the same policy the server-function wire applies ([RFC 10](10-server-functions.md#thrown-errors-sanitized-by-default)). A `"use server"` function called in-process during a render never touches that wire, so without this the production page load leaked exactly what the RPC withheld ([#3468](https://github.com/solidjs/solid/issues/3468)).
140
+
141
+
The boundary sanitizes _before_ rendering its fallback, and serializes the same replacement: the fallback is rendered on the server with the error and hydrates against the record, so the two must agree. A fallback that prints `err().message` therefore shows the generic message in production, as it would for a server-function failure. `markSafeError` is the escape hatch on both wires — a branded error passes through with its own properties. An Error reached as a _value_ (never thrown — a form's field errors, say) is data and passes as written.
142
+
143
+
The dev/prod line is the build variant: the `development` export condition's server artifacts keep full fidelity; the production and observe artifacts sanitize. The observe tier records each replacement once as `SSR_ERROR_SANITIZED` (advisory; `data.error` the original), beside the `SSR_RENDER_ERROR_CONTAINED` finding that carries the failure itself — the server keeps the truth, the wire gets the generic.
144
+
137
145
### The trace the request belongs to: `getTraceContext()`
138
146
139
147
A distributed trace follows one user action across every service it touches; each hop needs the trace's id and the id of the span that called it, carried across HTTP by the W3C Trace Context header `traceparent` (`00-<traceId>-<parentId>-<flags>`, with `tracestate` and `baggage` beside it). The runtime reads that half of the exchange once per request and exposes it:
0 commit comments