Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[2.0] A memo whose first read rejected reads `undefined` (not NotReady) in a verdict pass while it is re-asked

Geschlossen
#4,244 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
frontend

Rechercherichtung

Start with packages/signals/src/core/async.ts and core/verdict.d.ts, then trace how notifyStatus and verdictValue handle an initially rejected memo when it is re-asked. Reproduce with the issue's createSignal, createMemo, and isPending example; compare the observed [true, undefined] with the expected NotReadyError. Done when the re-ask and related latest or createDeferred reads no longer expose undefined before a value lands.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Version: solid-js / @solidjs/signals 2.0.0-rc.16, rc.17 and rc.18 (not rc.15).

The isPending contract (signals core/verdict.d.ts): "A read that has no value yet is loading, not pending — the probe reports only updates to a value that already exists."

Repro (no boundaries needed):

const [n, setN] = createSignal(0)
const m = createMemo(() => {
  const i = n()
  return i === 0 ? Promise.reject(new Error('boom')) : new Promise(r => setTimeout(() => r({ key: 'a' }), 50))
})
createRenderEffect(
  () => { try { return [isPending(() => m()), m()] } catch (e) { return [e] } },
  v => console.log(v)
)
// after the rejection: StatusError, as expected
setN(1) // re-ask
// observed until the landing: [true, undefined]   -- expected: NotReadyError (no value has ever landed)

Cause (dev build): notifyStatus(STATUS_ERROR) clears STATUS_UNINITIALIZED (packages/signals/src/core/async.ts), so after the re-ask verdictValue treats the node as initialized and pending and returns el._value (undefined). latest(() => m()) and createDeferred read the same.

Effect in an app: a list whose first read failed; its Retry re-asks it; a <Show when={isPending(() => page()) && …}> in the region (or any pass that probes isPending and then reads the page) dereferences undefined and throws a TypeError into the error boundary, so the retried rows never paint.

Vorherrschende Sprache
TypeScript
Sterne
36.2k
Forks
1.1k
Ø Merge
11 Std.
Gemergte PRs (30 T.)
343

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus solidjs/solid

Alle Issues in solidjs/solid

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.