fix: read the error status of App.Error in the prerender and query.live remote functions - #16529
Merged
teemingc merged 5 commits intoJul 27, 2026
Merged
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/336980a4076e759b9839af1e8b61f4616e06875aOpen in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: 336980a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
teemingc
reviewed
Jul 27, 2026
teemingc
requested changes
Jul 27, 2026
teemingc
reviewed
Jul 27, 2026
Member
|
This reminds me that we had planned to do this: #16540 |
teemingc
reviewed
Jul 27, 2026
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
App.Error in the prerender and query.live remote functions
Rich-Harris
pushed a commit
that referenced
this pull request
Jul 28, 2026
…-running the function (#16535) Follow-up to #16529. When the self-fetch of a prerendered remote function falls through to a live server, a thrown error comes back as HTTP 200 with a `type: 'error'` body, and the `error()` call meant to surface it throws into the same catch as the "no prerendered file" fallback. The error is swallowed and the function runs a second time locally. Unchanged since #13986. The try now covers retrieval only, and an error body throws `HttpError` directly, matching what the client does with the same response. Non-dynamic functions hit the treeshaken stub on both paths anyway, so in practice this affects `dynamic: true` functions: one execution per failure, and SSR shows the same error the client would get. A dynamic function that failed on the cookie-less self-fetch but succeeded locally was previously rescued silently; it now errors. Prerendered redirect bodies still resolve to `undefined` here; that's #16330's wire format, left alone. Now that #16529 has merged, this is standalone.
Rich-Harris
pushed a commit
that referenced
this pull request
Jul 29, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to version-3, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `version-3` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `version-3`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @sveltejs/adapter-vercel@7.0.0-next.4 ### Major Changes - breaking: remove support for edge and Node 20 runtimes ([#16520](#16520)) ### Patch Changes - chore: bump `@vercel/nft` dependency ([#16522](#16522)) - Updated dependencies [[`6942ddb`](6942ddb), [`68137d4`](68137d4), [`15dc603`](15dc603), [`a4f1521`](a4f1521), [`629b45d`](629b45d), [`7a7833a`](7a7833a), [`e6591a0`](e6591a0), [`7a7833a`](7a7833a), [`b196a39`](b196a39), [`66bf343`](66bf343), [`4bde76b`](4bde76b), [`d9f05cb`](d9f05cb), [`40efca1`](40efca1), [`8ef5548`](8ef5548), [`9efb8f2`](9efb8f2), [`6a670dc`](6a670dc), [`3416dcc`](3416dcc), [`6850fa5`](6850fa5), [`e6591a0`](e6591a0), [`688bead`](688bead), [`b596610`](b596610), [`0f26c13`](0f26c13), [`110a3db`](110a3db), [`665d467`](665d467), [`9c8c60c`](9c8c60c)]: - @sveltejs/kit@3.0.0-next.13 ## @sveltejs/kit@3.0.0-next.13 ### Major Changes - breaking: replace the `noScroll` and `keepFocus` options of `goto` with a single `reset` option, and the `data-sveltekit-noscroll` and `data-sveltekit-keepfocus` attributes with `data-sveltekit-reset` ([#16558](#16558)) - breaking: deprecate `error(status, {...})` in favour of `error(status, message, {...})` ([#16540](#16540)) ### Minor Changes - feat: add shallow routing to `goto` and deprecate `pushState` and `replaceState` ([#16449](#16449)) - feat: preserve page state set through `goto(..., { state, persistState: true })` across reloads ([#16449](#16449)) ### Patch Changes - chore: deduplicate repeated CSP directive handling ([#16498](#16498)) - fix: avoid Vite dev server reload on initial page request ([#16553](#16553)) - fix: don't set a `null` `accept-language` header on internal `fetch` sub-requests when the incoming request has none ([#16527](#16527)) - fix: correctly detect prerendered paths in server `fetch` when `paths.base` is set ([#16525](#16525)) - fix: don't duplicate remote modules in the generated manifest ([#16532](#16532)) - fix: exclude inlined files from the page's `$app/manifest` immutable list ([#16531](#16531)) - perf: avoid quadratic remote form issue merging ([#16493](#16493)) - fix: don't attempt to serialize fetch responses when the request body is not a string or TypedArray ([#16501](#16501)) - fix: read the error status of `App.Error` in the `prerender` and `query.live` remote functions ([#16529](#16529)) - fix: propagate errors from prerendered remote responses instead of re-running the function ([#16535](#16535)) - fix: respect the status returned from `handleError` on the fallback error page served to error-page sub-requests ([#16528](#16528)) - fix: skip unnecessary `version.json` checks if `updated.current` is already `true` ([#16518](#16518)) - fix: allow generation of $app/tsconfig without TypeScript installed ([#16534](#16534)) - perf: use a `Set` to check element ids when validating fragment links during prerendering ([#16494](#16494)) - fix: only include `_app/immutable` files in `$app/manifest`'s `immutable` in the service worker ([#16531](#16531)) - fix: log errors caught by the Vite dev server handler ([#16550](#16550)) - fix: resolve `root` per instance of the SvelteKit Vite plugin ([#16513](#16513)) - fix: ignore path casing differences when warning about overridden Vite config on Windows ([#16545](#16545)) - fix: preserve the current URL search parameters when submitting a remote form without JavaScript ([#16373](#16373)) - fix: treeshake prerendered remote functions in the right chunks ([#16533](#16533)) - fix: error during development if the adapter does not support instrumentation and it exists ([#16548](#16548)) ## @sveltejs/adapter-netlify@7.0.0-next.5 ### Patch Changes - chore: replace @netlify/functions with @netlify/types for the Context type ([#16542](#16542)) - Updated dependencies [[`6942ddb`](6942ddb), [`68137d4`](68137d4), [`15dc603`](15dc603), [`a4f1521`](a4f1521), [`629b45d`](629b45d), [`7a7833a`](7a7833a), [`e6591a0`](e6591a0), [`7a7833a`](7a7833a), [`b196a39`](b196a39), [`66bf343`](66bf343), [`4bde76b`](4bde76b), [`d9f05cb`](d9f05cb), [`40efca1`](40efca1), [`8ef5548`](8ef5548), [`9efb8f2`](9efb8f2), [`6a670dc`](6a670dc), [`3416dcc`](3416dcc), [`6850fa5`](6850fa5), [`e6591a0`](e6591a0), [`688bead`](688bead), [`b596610`](b596610), [`0f26c13`](0f26c13), [`110a3db`](110a3db), [`665d467`](665d467), [`9c8c60c`](9c8c60c)]: - @sveltejs/kit@3.0.0-next.13 ## @sveltejs/adapter-static@4.0.0-next.2 ### Patch Changes - fix: match adapter-vercel's prerendered redirect handling when deploying to Vercel ([#16497](#16497)) - Updated dependencies [[`6942ddb`](6942ddb), [`68137d4`](68137d4), [`15dc603`](15dc603), [`a4f1521`](a4f1521), [`629b45d`](629b45d), [`7a7833a`](7a7833a), [`e6591a0`](e6591a0), [`7a7833a`](7a7833a), [`b196a39`](b196a39), [`66bf343`](66bf343), [`4bde76b`](4bde76b), [`d9f05cb`](d9f05cb), [`40efca1`](40efca1), [`8ef5548`](8ef5548), [`9efb8f2`](9efb8f2), [`6a670dc`](6a670dc), [`3416dcc`](3416dcc), [`6850fa5`](6850fa5), [`e6591a0`](e6591a0), [`688bead`](688bead), [`b596610`](b596610), [`0f26c13`](0f26c13), [`110a3db`](110a3db), [`665d467`](665d467), [`9c8c60c`](9c8c60c)]: - @sveltejs/kit@3.0.0-next.13 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#16162 removed
ServerErrorNode.status(the status now lives onApp.Error) and updated the readers inshared.svelte.js, leaving two behind inquery.live's iterator and the prerendered-response reader. This ports them to the same shape and makes the type assertion on the prerendered response actually apply (it was unparenthesized, so the stale read never failedpnpm check). The prerendered-error branch still falls into the surrounding catch and re-runs the function, which is a separate issue.