Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/extract-diagnostics.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const FIX_STARTS = {
HEAD_TAG_INVALID: "`non-head-tag`/`invalid-attribute`: only head elements",
HOT_SCOPE_RERUNS: "The message names the latest cause",
LAZY_ASSET_UNMAPPED: "This is bundler-plugin configuration",
LOADING_ON_ACCESSOR: "`on` takes the dependency's value",
PENDING_ASYNC_UNTRACKED_READ: "Async values must be read where tracking",
RUN_WITH_DISPOSED_OWNER: "This usually means a stale owner",
SSR_BOUNDARY_WATERFALL: "The same repairs apply, in the same order",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Naming your memos and effects (`{ name }`) turns the trailing `effect` in the `i
| [`INVARIANT_VIOLATION`](/reference/solid-js/diagnostics/invariant-violation) | `error` | `error` | Internal consistency check failed (throws under `__TEST__`, reported in dev) |
| [`LATE_HEADER_WRITE`](/reference/solid-js/diagnostics/late-header-write) | `head` | `error` | Response header written after the head was sent; dropped (observe + dev; dev throws) |
| [`LAZY_ASSET_UNMAPPED`](/reference/solid-js/diagnostics/lazy-asset-unmapped) | `ssr` | `warn` | `lazy()` component's client assets could not be resolved for the page (dev) |
| [`LOADING_ON_ACCESSOR`](/reference/solid-js/diagnostics/loading-on-accessor) | `async` | `warn` | `<Loading on>` received a function (an accessor) instead of the dependency's value; it is never called, so the boundary never re-arms |
| [`LOADING_ON_OUTSIDE_HOLD`](/reference/solid-js/diagnostics/loading-on-outside-hold) | `async` | `warn` | `<Loading on>` changed but its data is also read outside the boundary and holds the frame: the fallback can never be seen |
| [`LONG_HOLD`](/reference/solid-js/diagnostics/long-hold) | `responsiveness` | `info`, `warn` | Acknowledged hold whose tail (last input → commit) ran 500ms+/1000ms+ (attribution enabled) |
| [`LOWERCASE_EVENT_ATTRIBUTE`](/reference/solid-js/diagnostics/lowercase-event-attribute) | `render` | `warn` | A function was set on a lowercase `on*` (or `on:`) attribute, which is not an event handler in 2.0; use `onXxx` (dev; client) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "LOADING_ON_ACCESSOR"
category: "Diagnostics"
use_cases: "loading_on_accessor diagnostic, console warning repair, diagnostics assertion"
tags:
- "diagnostics"
- "async"
- "warn"
- "reference"
- "v2"
version: "2.0"
description: "LOADING_ON_ACCESSOR: `<Loading on>` received a function (an accessor) instead of the dependency's value; it is never called, so the boundary never re-arms."
source_repo: "solidjs/solid"
source_ref: "next"
source_path: "packages/solid/skills/reactivity-diagnostics/SKILL.md"
---

{/* Generated by scripts/extract-diagnostics.mjs from packages/solid/skills/reactivity-diagnostics/SKILL.md and packages/solid/diagnostics.json in solidjs/solid. Edit the skill, then regenerate. */}

`<Loading on>` received a function (an accessor) instead of the dependency's value; it is never called, so the boundary never re-arms.

## What you saw

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

The console report opens with `[LOADING_ON_ACCESSOR]` 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: "LOADING_ON_ACCESSOR"`, `ownerPath`, and `loc`.
[Diagnostics](/reference/solid-js/diagnostics#read-a-report) explains each line.

## Why it fires

A Loading boundary's `on` received a function, such as `on={route}` or `on={() => route()}`.

## How to fix it

`on` takes the dependency's value, so pass `on={route()}`, or `on={[query(), page()]}` for several dependencies.
An accessor passed instead is never called, nothing is read, and the boundary never re-arms.

## In tests

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

## Learn more

- [Diagnostics](/reference/solid-js/diagnostics): every code, with its kind, severity, and trigger.
- [Debugging reactivity](/guides/debugging-reactivity): how to read a report and what each group of codes points at.
Loading