ON_FLUSH_IN_OWNED_SCOPE
onFlush called in a component body or computation (meant for event handlers and effect callbacks).
What you saw
- Kind:
lifecycle - Severity:
warn(code that works but is structurally wrong or expensive)
The console report opens with [ON_FLUSH_IN_OWNED_SCOPE] 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: "ON_FLUSH_IN_OWNED_SCOPE", ownerPath, and loc.
Diagnostics explains each line.
Why it fires
onFlush was called in a component body or a computation; it is meant for event handlers and effect callbacks.
How to fix it
Use onSettled for work after a component's first stable render, and keep side effects out of computations.
In tests
captureArtifact from @solidjs/diagnostics runs a scenario with the diagnostics channel open and returns the events it saw.
expectNoDiagnostics(artifact) fails while ON_FLUSH_IN_OWNED_SCOPE 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
- Diagnostics: every code, with its kind, severity, and trigger.
- Debugging reactivity: how to read a report and what each group of codes points at.