Diagnostics

PRIMITIVE_IN_EFFECT_CALLBACK

Memo, effect, or root created inside an effect callback or its cleanup, where there is no ambient owner (throws).


What you saw

  • Kind: lifecycle
  • Severity: error (broken behavior)

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


Why it fires

A memo, effect, or root was created without an owner inside an effect callback or its cleanup. The effect phase has no ambient owner, so those computations cannot be disposed or held by a parent.


How to fix it

Create them in the compute phase, or attach them to an existing owner with runWithOwner. Creating a signal alone does not trigger this error.


In tests

captureArtifact from @solidjs/diagnostics runs a scenario with the diagnostics channel open and returns the events it saw. expectNoDiagnostics(artifact) fails while PRIMITIVE_IN_EFFECT_CALLBACK 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