Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[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)

オープン 初心者向け
#3,973 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

solidjs/solid のほかの issue

solidjs/solid の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。