[2.0 rc.14 / next] SSR: a rejection contained by `<Errored>` is still an unhandled rejection when an async sibling shares its children slot (exits Node)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 66/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nodejs, typescript
- 領域
- frontend
調査の方向性
エラーは packages/solid/src/server/signals.ts の createErrorBoundary で発生しており、そこで結合された Promise.all(pending.p) が作成され、NotReadyError として throw されています。まずそこから始めて、兄弟要素がスロットを pending のままにしているのに、なぜその promise を待つものがないのかを確認してください。issue の再現手順を実行すると、未処理の rejection として Error: boom が表示されるはずです。未処理の rejection が報告されず、HTML 出力が変わらず、Errored のフォールバックが引き続きレンダリングされていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
During renderToStream, an async read that rejects under <Errored> is contained (the fallback renders), but the rejection is also left unhandled when the boundary shares a {props.children} slot with an async sibling. Node's default --unhandled-rejections=throw then ends the process. Another <Errored> around the whole tree does not help: the error is not escaping the render, it is an internal promise nobody handles.
Reproduction
import { renderToStream } from "@solidjs/web";
import { createMemo, Errored, Loading } from "solid-js";
import type { ParentProps } from "solid-js";
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
process.on("unhandledRejection", (reason) => console.log("unhandled:", String(reason)));
function Layout(props: ParentProps) {
return <main>{props.children}</main>;
}
function Fails() {
const value = createMemo(async () => {
await delay(5);
throw new Error("boom");
});
return <p>{value()}</p>;
}
function Later() {
const value = createMemo(async () => {
await delay(20);
return "later";
});
return <p>{value()}</p>;
}
renderToStream(() => (
<Loading fallback={<p>loading</p>}>
<Layout>
<Errored fallback={(_error) => <p>failed</p>}>
<Fails />
</Errored>
<Later />
</Layout>
</Loading>
)).then((html) => console.log(html));
| HTML | unhandledRejection |
|
|---|---|---|
| as above | <main><p>failed</p><p>later</p></main> |
Error: boom |
wrapped in another <Errored> |
same | Error: boom |
<Later /> removed |
<main><p>failed</p></main> |
none |
<Later /> after </Layout> |
<main><p>failed</p></main><p>later</p> |
none |
no <Layout> (both directly in <Loading>) |
<p>failed</p><p>later</p> |
none |
Without the handler, Node exits. Reproduces on 2.0.0-rc.14, also with #3936 applied; the code below is unchanged on next.
Cause
The server boundary's resolve (packages/solid/src/server/signals.ts, createErrorBoundary) throws a combined promise while its holes are pending:
const all: any = Promise.all(pending.p);
if (pending.p.some(p => (p as any).$clientHole)) all.$clientHole = true;
throw new NotReadyError(all);
When the sibling keeps the slot pending and the slot is retried, nothing awaits that all any more, so its rejection is reported even though the boundary handled the error and rendered its fallback.
Expected
A rejection that <Errored> contains is handled, as for a rejecting direct child of <Loading> (#3570, #3594) and in the browser (#3769).
Possible fix
Mark the combined promise handled where it is created; whoever awaits it still sees the rejection:
const all: any = Promise.all(pending.p);
all.catch(() => {});
With that line in rc.14's dist/server.dev.js, the reproduction reports no unhandled rejection and renders the same HTML.
(submitted by Claude Opus 5.5 on behalf of rvlzzr)
- 主要言語
- TypeScript
- スター
- 36.1k
- フォーク
- 1.1k
- 平均マージ
- 9時間 56分
- マージ済み PR(30日)
- 336
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
solidjs/solid#3975 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 32/100
solidjs/solid#3974 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
hydrate() run mid-parse leaves dead server nodes beside fresh client copies (async entry script)オープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
a2ui-project/a2ui#3158 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
hemilabs/ui-monorepo#2475 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
lingdojo/kana-dojo#32279 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
github/gh-aw-firewall#9879 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Arrow-key cursor movement in combined diff view doesn't scroll to keep the cursor visibleオープンos:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信