You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d8618c8
Browse filesBrowse the repository at this point in the historyBrowse files
fix(pages): deferred props, action responses and dev rescan errors (#517)
Fixes six bugs in Pages SSR: deferred props, action responses, and dev
rescans.
| Bug | Before | Now |
|---|---|---|
| A page scan error during a dev rescan (e.g. `layout: docs` before
`_layouts/docs.*` exists) | unhandled rejection, `void dev` exits | the
error is logged and the last good scan is kept; the next change rescans
|
| A deferred value whose object has a key named like another deferred
prop | the value lands in that other prop, and its own prop never
resolves | a group resolves only its own keys |
| A deferred resolver that throws, in prefetch or prerender | silent
`null`, baked into `_void/pages/*.json` | sent as `deferredErrors`, and
the client rejects that prop as it does when streaming |
| A deferred resolver that returns `undefined`, on client navigation |
stays loading forever | resolves to `null`, as on a full page load |
| A loader that returns a redirect or 404 after an action | page renders
with `{}` props | the loader's Response is returned, as on a GET |
| A 400 from an action that is not from `withValidator` | a text body
becomes a 500; a JSON body is swallowed | passed through unchanged; only
an `issues` body becomes field errors |
## How
```
protocol.ts runLoader(): one rule for GET and post-action loader runs
prefetch: deferredErrors per failed group; undefined → null
NDJSON: data ?? null
400: clone().json() → issues[] ? field errors : pass through
navigation-engine resolveGroup: one key → raw value; several keys → value[key]
setup(resolved): a key whose group is in deferredErrors is rejected
retainOnly keeps full groups, so a preserved part of a group still splits correctly
islands-plugin + rescan errors are handled; the adapter pages plugin logs them once
4 adapter plugins
```
The deferred rule is the one the server's prefetch path and the docs
("Grouped Deferred Props") already use.
## Tests
- **New tests:** 17, in `pages-client`, `pages-protocol`, the new
`pages-islands-rescan`, and the react/vue/svelte/solid `plugin-pages`
tests. All 17 fail on `main`.
- **Unit tests:** the pages, prerender and island files in void pass
(326 tests), as do all the adapters' unit tests.
- **Browser tests:** React 44/44 and Vue 30/30.
- **Checks:** typecheck for void and the 4 adapters, lint and format are
clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0 commit comments