Skip to content

[2.0 / next] An own error over a held write flashes the Errored fallback at the landing when the reader is a memo (inline render effect doesn't) #4407

Closed

Description

@ryansolid

Summary

A reader computes latest(a) + b() + 1 and throws its own error at one value. a and b are written in the same batch as a slow async memo that holds the write. When the hold lands, the reader's result goes title=2 → [E own:3] → title=6 if it is read through a memo, but title=2 → title=6 if the same function runs directly in a render effect. JSX grouping changes the result (the #4401 / #4284 parity rule: a latest() read inline and through a memo show the same screen).

The content isn't remounted (one mount) and the final screen is right, but the Errored boundary's fallback is shown during the landing flush.

Reproduction

const [a, setA] = createSignal(1);
const [b, setB] = createSignal(0);
const [c, setC] = createSignal(1);
let resolve!: () => void;
createRoot(() => {
  const slow = createMemo(() => {
    const v = c();
    return v > 1 ? new Promise<number>(r => (resolve = () => r(v))) : v;
  });
  createRenderEffect(slow, () => {});
  const f = () => {
    const v = latest(a) + b() + 1;
    if (v === 3) throw new Error("own:3");
    return v;
  };
  const view = createErrorBoundary(
    () => untrack(() => {
      const m = createMemo(f);                  // inline form: createRenderEffect(f, show)
      createRenderEffect(() => m(), v => log(`title=${v}`));
      return "content";
    }),
    e => `[E ${e()?.message}]`
  );
  createRenderEffect(() => view(), v => v !== "content" && log(String(v)));
});
flush();
setA(2); setB(3); setC(2); flush();   // held by `slow`
// ...settle...
resolve();                             // landing

Full probe (memo and store sources, five reader shapes, memo vs effect): zz-own-err-3945.test.ts, run on next at 9baaba3.

shape memo reader effect reader
own error only title=2, [E own:3], title=6 title=2, title=6
catches an errored source, then own error title=2, [E own:3], title=6 title=2, title=2, title=6
rethrows source error as own title=2, [E own:3], [E own-x] title=2, title=2, [E own-x]

Expected

The memo and inline forms show the same sequence, without the fallback in between: the own:3 pass (latest(a) = 2 beside the held b() = 0) isn't a screen the landing should show.

Notes

Activity

  1. ryansolid commented on Oct 29, 2026

    @ryansolid
    MemberAuthor

    Fixed on next by #4409 (822fa01); it ships in the next RC.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions