Diagnostics

STRICT_READ_UNTRACKED

Untracked reactive read in component/effect body.


What you saw

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

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


Why it fires

A reactive value was read outside any tracking scope (e.g. destructured props or a signal called in the component body). The read got the current value once and will never update.


How to fix it

Move the read to where the value is used, inside a tracking scope: JSX, a memo, an effect's compute function, or an API that takes an accessor.

Pick the repair by what the value is for:

  • Rendered: read it in JSX, <h1>{props.title}</h1>.
  • Derived: use a function, const total = () => props.price * props.qty, or createMemo.
  • An input to async data: read it in the compute, createMemo(() => fetchUser(props.id)).
  • Passed to a hook or primitive: pass an accessor, useThing(() => props.id), not useThing(props.id).
  • The seed of local editable state: use a writable derived signal, createSignal(() => props.initial), which resets when the source changes.
  • The initial value of a form control: defaultValue={props.initial} on the element.
  • Needed by a side effect: createEffect(() => props.id, (id) => ...).
  • Needed when an event fires: read it inside the handler, onClick={() => save(props.id)}.
  • An argument of a flow callback (<For>, <Show>): read the accessor in JSX inside the callback, not at its top.
  • Config for an object built once (a client, an actor, a chart): build it in a memo over the reads so it is rebuilt, or apply changes to it in an effect.
  • A deliberate one-time snapshot that must never update: wrap the read in untrack(() => props.value) to say so. This is the author deciding the value never follows its source, not a way to clear the warning. It is only safe when the value is never downstream of async. A value that comes from async data can still be pending (the read throws) or mid-transition (the snapshot is the old committed value). A component rarely knows where its props come from, so a prop is seldom safe to snapshot.

Coding agents: do not wrap the read in untrack() to make the warning go away. That keeps the bug (the value still never updates) and only hides the report. Leave untrack to a person who has decided the value is fixed.

Writing a hook or library adapter: take () => T (or T | (() => T)) and read it inside your own memos and effects. A hook that wraps its argument reads in untrack to be "warning-free" freezes every caller's value; the warning was pointing at that. Destructuring props (function C({ id })) is the same read: use props.id.

When the context is "an event handler expression", the read is in the expression an element's handler is bound from (onClick={selected() ? a : b}, onClick={makeHandler(id())}, or a component prop forwarded to an element that the parent passed a reactive expression). Handlers are bound once and are not reactive: move the read inside the handler function (onClick={() => (selected() ? a() : b())}), and pass plain functions down as handler props.


In tests

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