Diagnostics

CAUGHT_REACTIVE_READ

A computation caught a reactive read's throw (not ready, or the source's error) and completed with a value: the load is masked or the error hidden; once per node.


What you saw

  • Kind: async
  • Severity: warn (code that works but is structurally wrong or expensive)

The console report opens with [CAUGHT_REACTIVE_READ] 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: "CAUGHT_REACTIVE_READ", ownerPath, and loc. Diagnostics explains each line.


Why it fires

A computation wrapped a reactive read in try/catch as it would an await, the read threw (not ready, or the source's error), the catch swallowed it, and the computation completed with a substitute value. The throw was addressed to the graph: NotReadyError is how the read suspends to the nearest <Loading> boundary or holds the change, and an error is how it reaches <Errored> or createEffect's error arm — the catch masks the first load, hides the error, and on the server the substitute is the answer. It is also unreliable: when the source goes pending or errored later, this computation is marked with that status and not re-run, so the catch will not fire again.


How to fix it

Remove the try/catch. Branch on readiness with isPending(source), show the last value ahead of the landing with latest(() => …), or let the read suspend to a <Loading> boundary; handle errors with <Errored> or createEffect's error option. An interop layer that must catch should re-throw NotReadyError (catch (e) { if (e instanceof NotReadyError) throw e; … }), which does not warn. An async computation is judged when its promise settles: a read before the first await that throws becomes the rejection (the throw continuing, no warning); a value landing after such a throw is the catch. Reported once per computation, on the pass where the catch ran; a catch the status propagation bypasses is not detected.


In tests

captureArtifact from @solidjs/diagnostics runs a scenario with the diagnostics channel open and returns the events it saw. expectNoDiagnostics(artifact) fails while CAUGHT_REACTIVE_READ 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: 11/16/26, 6:55 AMEdit this pageReport an issue with this page