Repository navigation
fix: allow reroute to point to prerendered route - #13575
Merged
Merged
Conversation
When rerouting to a path that is a prerendered page, the runtime would previously return a 404, because said path does not point to a route in the manifest. This adds a check for this specifically to do a fetch to the prerendered page in that case.
🦋 Changeset detectedLatest commit: 5c95668 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 |
Rich-Harris
approved these changes
Mar 12, 2025
Merged
Copilot AI
pushed a commit
to Stadly/kit
that referenced
this pull request
Mar 6, 2026
When rerouting to a path that is a prerendered page, the runtime would previously return a 404, because said path does not point to a route in the manifest. This adds a check for this specifically to do a fetch to the prerendered page in that case.
Rich-Harris
pushed a commit
that referenced
this pull request
Jul 29, 2026
…server fetch (#16525) `has_prerendered_path` expects a base-inclusive pathname (its JSDoc says so, and the `respond` call site passes one), but the `fetch` call site prepends `base` to a pathname that already contains it, so the prerendered bail-out never matches when `paths.base` is set. #13575 extracted the helper out of this check and added a second caller in `respond.js`, prefixing `base` here in the same hunk; before that, `fetch` checked `prerendered_routes.has(decoded)` directly. With the bail-out firing, base-path apps also stop forwarding cookies and auth headers on these sub-requests, matching what apps without a base already do.
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.
When rerouting to a path that is a prerendered page, the runtime would previously return a 404, because said path does not point to a route in the manifest. This adds a check for this specifically to do a fetch to the prerendered page in that case.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.