Skip to content

[2.0 / next] latest(m) returns undefined for an uninitialized async memo after its latest() input changes (A7) #4363

Closed

Description

@ryansolid

Found by the async app generator (packages/web/test/async-gen, branch claude/project-thread-bgafe5), minimized.

const [s, set] = createSignal(1);
const log = [];
createRoot(() => {
  const m = createMemo(() => { const v = latest(s); return new Promise(() => {}).then(() => v); });
  createRenderEffect(
    () => { try { return latest(m); } catch (e) { return "throw:" + e.constructor.name; } },
    v => log.push(String(v))
  );
});
flush(); set(0); flush();
// log: ["throw:NotReadyError", "undefined"]

Expected: ["throw:NotReadyError", "throw:NotReadyError"]. A7 (amended 2026-09-14): "latest() of an uninitialized node throws in every scope, never undefined". The visibility-oracle "uninitialized" row pins this for a memo that is never re-asked.

Actual on next (1f558e5): after the write, latest(m) returns undefined, and a JSX hole renders undefined (or nothing). With s() instead of latest(s) in the memo, it keeps throwing NotReady as expected.

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