[2.0.4] `<Loading on>`: a read started by an effect's write in the mount flush is forwarded to the root instead of being caught
Maintainer thường phản hồi trong vòng 1 ngày
@MilindChatrabhuji đang làm issue này rồi.
Từ ngày 29/11/2026.
- #5270 của @MilindChatrabhuji — đang mở
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 57/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by running the supplied Vitest reproduction against Solid 2.0.4 and compare the “content reads the signal” and “content reads the memo” cases. Trace how Loading handles pending reads and re-arms when its on value changes during the mount flush. Done means both cases settle without ASYNC_OUTSIDE_LOADING_BOUNDARY; the issue names no repository source or test file to start from.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
With <Loading on={subject()}>, a pending read created and read entirely inside the boundary is passed up to the root instead of being caught, when the subject is written by an effect in the mount's own flush. DEV reports ASYNC_OUTSIDE_LOADING_BOUNDARY ("The root mount will be deferred until all pending async settles"), although there is no read of that data outside the boundary — LOADING_ON_OUTSIDE_HOLD is not raised.
The trigger is narrow: it happens when the content reads the signal the on memo is derived from rather than the memo itself, so the content's chain sits one hop closer to the write than the on expression. In the dev build the boundary is re-armed, but only after the read has already been passed up.
We hit this porting a Solid 1 app to Solid 2.
Your Example Website or App
Inline below — one test file, no app.
Steps to Reproduce the Bug or Issue
npm i [email protected] @solidjs/[email protected]
npm i -D vitest @solidjs/vite-plugin jsdom
npx vitest run
vitest.config.ts:
import solid from "@solidjs/vite-plugin";
import { defineConfig } from "vitest/config";
export default defineConfig({ plugins: [solid()] });
loading-on.test.tsx:
/** @jsxImportSource @solidjs/web */
// @vitest-environment jsdom
import { render } from "@solidjs/web";
import {
createEffect,
createMemo,
createSignal,
flush,
Loading,
OBSERVE,
} from "solid-js";
import { expect, test } from "vitest";
const diagnostics: string[] = [];
OBSERVE!.diagnostics.subscribe((e) => diagnostics.push(e.code));
const settle = async (): Promise<void> => {
for (let turn = 0; turn < 6; turn += 1) {
const { promise, resolve } = Promise.withResolvers<void>();
setTimeout(resolve, 0);
await promise;
}
};
const ask = (one: string): Promise<string> =>
new Promise((r) => setTimeout(() => r(`models of ${one}`), 5));
// The ONLY difference between the two runs: what the boundary's content reads
// to decide it has nothing to ask for yet — the signal the `on` memo is
// derived FROM, or that memo itself.
for (const contentReads of ["the signal", "the memo"] as const)
test(`content reads ${contentReads}`, async () => {
diagnostics.length = 0;
const App = () => {
const [picked, setPicked] = createSignal<string | undefined>(undefined);
const subject = createMemo(() => picked());
// the subject is seeded by an EFFECT, in the mount's own flush
createEffect(
() => picked(),
(one) => {
if (one === undefined) setPicked("claude");
},
);
const Asked = (shown: { subject: string | undefined }) => {
const answer = createMemo(() =>
shown.subject === undefined ? undefined : ask(shown.subject),
);
const chosen = contentReads === "the signal" ? picked : subject;
const offer = createMemo(() =>
chosen() === undefined ? "choose one first" : (answer() ?? "asking…"),
);
return <p>{offer()}</p>;
};
return (
<Loading on={subject()} fallback={<p>LOADING</p>}>
<Asked subject={subject()} />
</Loading>
);
};
const root = document.createElement("div");
document.body.append(root);
const dispose = render(() => <App />, root);
flush();
const afterTheMountFlush = root.textContent;
await settle();
console.log(
`content reads ${contentReads}: after the mount flush ${JSON.stringify(afterTheMountFlush)}, ` +
`settled ${JSON.stringify(root.textContent)}, diagnostics ${JSON.stringify(diagnostics)}`,
);
expect(diagnostics).toEqual([]);
dispose();
root.remove();
});
Output on [email protected]:
stdout | loading-on.test.tsx > content reads the signal
content reads the signal: after the mount flush "LOADING", settled "models of claude", diagnostics ["ASYNC_OUTSIDE_LOADING_BOUNDARY"]
stderr | loading-on.test.tsx > content reads the signal
[ASYNC_OUTSIDE_LOADING_BOUNDARY] An async value was read outside a Loading boundary. The root mount will be deferred until all pending async settles.
× content reads the signal
✓ content reads the memo
Tests 1 failed | 1 passed (2)
The control (content reads the memo) is clean: same component, same effect-written subject, same async read — only the read in the "nothing chosen yet" branch differs.
Expected behavior
Nothing under the boundary should reach the root. Per the Loading docs, "Any computation … that throws because data isn't ready is caught by the nearest enclosing <Loading>", and a change to what on reads makes the boundary "stop waiting on its current content and show fallback again if something under it is still pending". answer is created in Asked, which is inside <Loading>, and nothing else reads it, so the boundary should catch it and no diagnostic should be raised in either run.
Actual: the read is forwarded past the boundary to the root, the root mount is deferred until the async settles, and DEV reports the read as being outside a Loading boundary.
Platform
- OS: Linux
- Node: 24
- DOM: jsdom (via vitest)
- Versions:
solid-js/@solidjs/web2.0.4 (latest) and 2.0.3 — identical output on both;@solidjs/vite-plugin3.0.1
Additional context
LOADING_ON_OUTSIDE_HOLDis not raised, which matches the code: there is no outside reader of the data.- In the dev build the boundary's
onpass does re-arm, but it runs after the pending read has already been passed up — the arm appears to lose a race with the content, which is woken one hop earlier by the same write. A boundary born with its subject (a keyed<Show>around a fresh<Loading>) is unaffected, which is the workaround we are using. - Only a write from an effect during the mount flush triggers it; the same change from a click handler, or from an effect after the first settle, re-arms correctly.
This was written by an AI agent (Claude) under a human maintainer's direction.
- Ngôn ngữ chính
- TypeScript
- Star
- 37k
- Fork
- 1.2k
- Merge trung bình
- 8 giờ 43 phút
- Pull request đã merge (30 ngày)
- 365
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[2.0.4] Nested `<Errored>`: the outer boundary stays on an error the inner one rethrew, after the next error is one the inner one handlesCó thể đã có người làm @MilindChatrabhuji đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
activepieces/activepieces#17974 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
OHDSI/Data2Evidence#3777 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AOSSIE-Org/PictoPy#1802 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Termix-SSH/Plugin-Snippets#26 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-reported bug from-app needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightly-labs/openbot#20504 ·
Maintainer thường phản hồi trong vòng 1 ngày