[2.0.4] Rows never render when a memo derived from latest(asyncMemo) feeds a second async memo (regression since @solidjs/signals rc.22)

オープン
#5,211 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@brenelz がすでに取り組んでいます。

2026年11月26日 から。

  • #5213 @brenelz による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, typescript
領域
frontend, testing

調査の方向性

Start by reading the failing Vitest reproduction described in the issue and trace how the chained async memos, latest, and the two Show branches update. Compare the behavior with signals rc.21 and inspect the regression introduced in rc.22. Done means the rows render as “Milk” on 2.0.4 behavior, with the reported reproduction passing.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

After two chained async memos resolve, a plain derived function that reads latest(lists) together with a memo derived from latest(lists) keeps its first result. The around the list never switches, so the rows never render: the container stays empty instead of showing "Milk". Effects on each input alone do update.

It works on 2.0.0-rc.21 and fails on every release from 2.0.0-rc.22 to 2.0.4. Bisecting by @solidjs/signals alone (with @solidjs/web rc.21) points to signals rc.22.

It looks related to #5108 (also a memo built on latest(list) with nested , also since rc.22, traced to #4865) and to #5073 (fixed in 2.0.4; its repro passes for us). This shape is client-only: no SSR, no hydration, no onSettled. It still fails on 2.0.4.

Your Example Website or App
Steps to Reproduce the Bug or Issue
  1. Open the repro and run npm install.
  2. Run npm test (vitest, happy-dom). The test fails: expected '' to be 'Milk'.
  3. Pin @solidjs/signals to 2.0.0-rc.21 with npm overrides (and solid-js / @solidjs/web to 2.0.0-rc.21), then run npm install and npm test again. The test passes.

The component under test:

import { createMemo, latest, For, Show } from "solid-js";

const wait = <T,>(v: T, ms = 5) => new Promise<T>((r) => setTimeout(() => r(v), ms));

function Page() {
  const lists = createMemo(() => wait(["l1"]), { loadingValue: undefined });
  const active = createMemo(() => latest(lists)?.[0] ?? null);
  const items = createMemo(
    () => (active() ? wait({ key: active(), rows: ["Milk"] }) : undefined),
    { loadingValue: undefined },
  );
  const rows = () => {
    const r = latest(items);
    return r && r.key === active() ? r.rows : undefined;
  };
  const loading = () => !latest(lists) || (active() !== null && !rows());
  return (
    <>
      <Show when={loading()}>loading</Show>
      <Show when={!loading()}>
        <div>
          <For each={rows() ?? []}>{(row) => <i>{row()}</i>}</For>
        </div>
      </Show>
    </>
  );
}

All three parts are needed for the failure: the active() !== null read in loading, the loading <Show>, and the <For> inside the other branch. Either of these changes makes it pass:

  • active reads lists() instead of latest(lists);
  • loading reads latest(active) instead of active().
Expected behavior

As a user, I expected the rows ("Milk") to render once both memos resolved, as on 2.0.0-rc.21, but I am seeing an empty container: the derived loading value never re-runs after the second memo resolves.

Screenshots or Videos

None. The test output on 2.0.4:

× renders the rows once both memos resolved
AssertionError: expected '' to be 'Milk'
Platform
  • OS: Linux (Debian 13)
  • Browser: none (vitest 5 with happy-dom 21; first seen in our app's test suite)
  • Version: solid-js 2.0.4, @solidjs/web 2.0.4, @solidjs/signals 2.0.4, @solidjs/vite-plugin 3.0.1, @solidjs/testing-library 1.0.0-rc.2. Works with solid-js, @solidjs/web and @solidjs/signals 2.0.0-rc.21.
Additional context

A second symptom in the same app, also since rc.22 (no standalone repro yet): after a source signal changes, effects that read only latest(source) don't re-run until a downstream async fetch for the new value lands, although an untracked latest(source) already returns the new value.

主要言語
TypeScript
スター
37k
フォーク
1.2k
平均マージ
8時間 43分
マージ済み PR(30日)
365

環境構築

はじめの一歩

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

solidjs/solid のほかの issue

solidjs/solid の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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