[🐞] ErrorBoundary: late-delivered fallback leaves the errored content's serialized state live
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 22.1k
- Forks
- 1.4k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
Which component is affected?
Qwik Runtime
Describe the bug
When a boundary sits outside a <Suspense> whose child rejects after the root has streamed (out-of-order, the default under the suspense flag), the fallback is delivered late through $emitFallback$. The rethrow-into-segment exit skips markErrorBoundaryContentInert, and by that point the root has already emitted its state and vnode-data — so the inert cut cannot reach the wire. The errored content resumes with live effect subscriptions: a bound attribute inside the hidden content keeps tracking, and a signal write updates the dead DOM (a bound img src fires a real network request for a torn-down subtree).
The DOM half is handled (the late path now registers a qErr swap that hides the content host and strips its q-d:*/q-w:* handlers). The state half needs a way to retract already-emitted rows, which the vnode-data patch channel cannot express today: patches only add or replace rows that carry data; an INERT-gated row emits as separator-only and leaves the earlier live row standing.
Reproduction
Pinned (skipped) in packages/qwik/src/core/tests/error-boundary.spec.tsx, describe "ErrorBoundary late-delivered fallback": "marks the errored content inert: a bound attribute stops tracking after resume".
System Info
Qwik v2, build/v2 lineage (PR #8745 branch), experimental errorBoundary + suspense flags
Additional Information
Same family as the retained-element-effects residue: the in-order path clears effects before emission; the late path has no emission left to gate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the skipped reproduction in packages/qwik/src/core/tests/error-boundary.spec.tsx, under “ErrorBoundary late-delivered fallback.” Trace the late $emitFallback$ path, markErrorBoundaryContentInert, and the vnode-data patch channel. Done means the resumed errored content is inert: its bound attribute no longer tracks or updates the dead DOM after the fallback arrives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100