Diagnostics

SERVER_ERROR_SANITIZED

Error replaced with the generic Error on the wire — data.source "server-function" (error) or "ssr" (info); data.error is the original (observe + dev).


What you saw

  • Kind: ssr
  • Severity: error (broken behavior) or info (advisory, delivered on the diagnostics channel and never printed)

The console report opens with [SERVER_ERROR_SANITIZED] and the message, then an in line naming the owners that enclose the subject, root first, and an at line with the source location when the code was compiled with one. In a captured artifact the same finding is an event with code: "SERVER_ERROR_SANITIZED", ownerPath, and loc. Diagnostics explains each line.


Why it fires

The production wire replaced an error with the generic Error; data.error is the original, data.wire what the client got, and data.source says which road:

  • "server-function" (error): a server function threw. Fix the failure it names. If the client is meant to see this error, brand it with markSafeError or map it in wrapInvocation; do not turn sanitization off.
  • "ssr" (info): a render failure reached the client — an <Errored> record, a rejected async source in the stream, a fragment's rejection, a frame's error chunk. Advisory: the failure itself is the SSR_RENDER_ERROR_CONTAINED finding beside it — fix that. If the client is meant to see this error, brand it with markSafeError; do not turn sanitization off. A fallback that prints err().message shows "Internal Server Error" in production by design.
Server rendering

The server runtime reports on the same channel, with the same in <App> › <Page> line. Two groups. Findings (SSR_RENDER_ERROR_CONTAINED, SSR_SUBTREE_ABANDONED, SSR_STREAM_ABANDONED, LATE_HEADER_WRITE, DYNAMIC_ASYNC_COMPONENT, SERVER_ERROR_SANITIZED, FRAME_MARKER_CORRUPTED) are facts about a render that exist in observe builds too — an APM sees them in production; in dev they print. Checks (the rest, SSR_BOUNDARY_WATERFALL and SSR_CLIENT_CONTENT_MASKED included) are dev-only guidance. A captured artifact from a server render carries both.


How to fix it

To report these failures from a production build (no OBSERVE), register the server error hook — configureServerErrors({ onError }) from @solidjs/web — which hears every handled failure once, and may return the value the client should see instead.


In tests

captureArtifact from @solidjs/diagnostics runs a scenario with the diagnostics channel open and returns the events it saw. expectNoDiagnostics(artifact) fails while SERVER_ERROR_SANITIZED is among them, with the events as evidence; after the fix, the code is gone from artifact.diagnostics. Check for regressions in tests shows the loop and the Vitest matcher form.


Learn more

Last updated: 10/15/26, 10:07 PMEdit this pageReport an issue with this page