-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Prerendering ignores webpages if a +server file exists in the same route, regardless of who exports prerender = true #15620
Copy link
Copy link
Open
Description
Describe the bug
SvelteKit can silently fail and/or refuse to prerender certain routes. This occurs when there is a +server.ts file in a route, regardless of its contents, next to a +page.svelte and a +page.server.ts with export const prerender = true. There are no warnings or other indications that prerendering has skipped this route, and SvelteKit informs the adapter that the route has been prerendered, leading to a 404 after build (see bun run preview).
Reproduction
clone https://github.com/aenriii/minrepro-svelte-prerender-fail with submodules, then
make deps
make test
Logs
System Info
System:
OS: Linux 6.19 CachyOS Linux
CPU: (16) x64 AMD Ryzen 7 2700 Eight-Core Processor
Memory: 9.75 GB / 23.39 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 22.22.2 - /usr/bin/node
npm: 11.12.0 - /usr/bin/npm
pnpm: 10.33.0 - /home/aenri/.bun/bin/pnpm
bun: 1.3.4 - /home/aenri/.bun/bin/bun
Deno: 2.7.8 - /usr/bin/deno
Browsers:
Firefox: 149.0
Firefox Developer Edition: 149.0
npmPackages:
@sveltejs/adapter-auto: ^7.0.0 => 7.0.1
@sveltejs/vite-plugin-svelte: ^6.2.4 => 6.2.4
svelte: ^5.54.0 => 5.55.1
vite: ^7.3.1 => 7.3.1Severity
annoyance
Additional Information
Tested from main branch, commit checked added as a submodule to the reproducing repository
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels