fix: keep resolve relative to initial base during prerender
#14533
Closing issue
Describe the bug
<script>
import { resolve } from "$app/paths";
</script>
<!--
[404] GET /lv1/lv1
node:internal/event_target:1101
process.nextTick(() => { throw err; });
^
Error: 404 /lv1/lv1 (linked from /lv1/lv2)
->
<!-- Link works in vite dev -->
<a href="{resolve('/lv1')}">Hey</a>
Reproduction
https://github.com/hyunbinseo/svelte-kit-14512
Logs
pnpm build
[404] GET /lv1/lv1
node:internal/event_target:1101
process.nextTick(() => { throw err; });
^
Error: 404 /lv1/lv1 (linked from /lv1/lv2)
pnpm i @sveltejs/[email protected] && pnpm build
> Using @sveltejs/adapter-auto
Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of your choosing
✔ done
System Info
System:
OS: Windows 11 10.0.26100
CPU: (8) x64 Intel(R) Core(TM) Ultra 7 258V
Memory: 5.24 GB / 31.48 GB
Binaries:
Node: 24.8.0 - ~\AppData\Local\fnm_multishells\42720_1758590779869\node.EXE
Yarn: 1.22.22 - ~\AppData\Local\fnm_multishells\42720_1758590779869\yarn.CMD
npm: 11.6.0 - ~\AppData\Local\fnm_multishells\42720_1758590779869\npm.CMD
pnpm: 10.17.1 - ~\AppData\Local\fnm_multishells\42720_1758590779869\pnpm.CMD
Browsers:
Edge: Chromium (140.0.3485.54)
npmPackages:
@sveltejs/adapter-auto: ^6.1.0 => 6.1.0
@sveltejs/kit: ^2.43.1 => 2.43.1
@sveltejs/vite-plugin-svelte: ^6.2.0 => 6.2.0
svelte: ^5.39.4 => 5.39.4
vite: ^7.1.7 => 7.1.7
Severity
blocking an upgrade
Pull request
Merged
L
LeeWxx Sep 25, 2025, 3:31 PMFixes #14512
Fixed $app/paths.resolve so prerendered builds no longer duplicate paths.base, and added a regression test that verifies the helper emits the correct relative href.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- This message body should clearly illustrate what problems it solves.
- Ideally, include a test that fails without this PR but passes with it.
Tests
- Run the tests with
pnpm testand lint the project withpnpm lintandpnpm check
Changesets
- If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.
Edits
- Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
Info
Merged at Sep 26, 2025, 6:25 PM
Merged by dummdidumm
Assignees None
Reviewers None
Labels None
Milestone None
C
changeset-bot[bot] Sep 25, 2025, 3:31 PM🦋 Changeset detected
Latest commit: 5c7dfe8
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @sveltejs/kit | Patch |
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
Pull request opened Sep 25, 2025, 3:31 PM
Verified
Verified
Verified
Verified
Pull request merged Sep 26, 2025, 6:25 PM
Total -2 +25
Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)