Catch: chunk load failures need a stable signal and consistent routing
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
Research direction
Read packages/qwik/src/core/shared/cursor/chore-execution.ts at the catch added by #8998 and packages/qwik/src/core/shared/error/error-handling.ts at handleQError, then inspect the existing test for qwikloader import failures. Define a stable import-failure signal and route component and event-handler chunk failures consistently through ErrorBoundary handling, with tests covering both paths.
Written by the indexing model from the issue text.
Description
Since #8998, a component whose chunk fails to import no longer loops, and the nearest <ErrorBoundary> renders its fallback. I think that is the right default, but two things are missing.
Apps cannot reliably detect a chunk load failure
The error that reaches onError$ is the browser's TypeError and the phase is render. The message differs per browser:
- Chrome:
Failed to fetch dynamically imported module - Firefox:
error loading dynamically imported module - Safari:
Importing a module script failed
The usual fix for a chunk 404 after a deploy is location.reload(), and onError$ has no stable way to tell "code is missing" from "code threw". Options:
- add an
ErrorBoundaryPhase.Importvalue - or tag the error in the
.catchadded by #8998 inexecuteComponentChore(packages/qwik/src/core/shared/cursor/chore-execution.ts)
Event handler chunk failures are not routed to boundaries
When an onClick$ chunk fails to import, the qwikloader emits qerror with importError set, and handleQError returns early (packages/qwik/src/core/shared/error/error-handling.ts). The error only reaches console.error. There is a test for this.
So today a broken component chunk shows the fallback, while a broken handler chunk shows nothing. Both are the same situation for the user. If we add an import phase, the qwikloader case should go through it too.
Verified
Spec run on current main:
| Failure | Inside <ErrorBoundary> |
Without a boundary |
|---|---|---|
| Component chunk import rejects | Fallback renders, phase render |
Subtree stays empty, error logged async |
useTask$ throws a rejected promise |
Fallback renders, phase hook |
Logged, render finishes |
onClick$ chunk import rejects |
Nothing, console.error only |
Same |
- Dominant language
- TypeScript
- Stars
- 22.1k
- Forks
- 1.4k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 98
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from QwikDev/qwik
-
docs router V2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
DX enhancement V2
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
QwikDev/qwik#8480 · 2 comments ·
Maintainers usually reply within 1 day
-
[🐞] SSG (rc.0+) ignores ssr.noExternal: bundled deps are left external in the new "ssg" environmentOpen
Difficulty 4/5 3-5 days Newbie friendliness 52/100
QwikDev/qwik#9183 · 1 comment ·
Maintainers usually reply within 1 day
-
[🐞] <Pending> child reading a signal from its owner breaks when the owner re-renders (consumerBackRef[_EFFECT_BACK_REF].set is not a function)Possibly taken @intellix claimed this 2 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
[🐞] Async useComputed$ resolved in an out-of-order <Pending> re-runs on the client at the first unrelated re-renderPossibly taken @intellix claimed this 2 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
Bump Firebase JS SDK (12.19.0 → 13.0.0)Possibly taken @SelaseKay claimed this today. OpenNeeds Attention type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
invertase/react-native-firebase#9364 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 4 days
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
redhat-developer/rhdh-plugin-export-overlays#4261 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] 官网文档的图片挂了Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
area:cli bug triage:in-progress
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day