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
When using the static adapter and prerendering the entire site, building on my local machine generates files with the .html extension for every route. Building on Vercel, however, only index.html has the .html extension. The other routes are missing an extension.
Vercel manages to resolve requests to those files even without the extension. However, the issue is with a 404 error handling route. To deal with invalid routes on a fully prerendered site, you need to provide a 404.html file for Vercel to use as a handler. Vercel needs 404.html with that exact name, so without the extension it doesn't work.
Furthermore, if you try to rename the route folders to contain the .html extension, then Vercel doesn't build them at all.
Reproduction
Fresh SvelteKit install with @sveltejs/adapter-static.
The text was updated successfully, but these errors were encountered:
andrei-livadariu
changed the title
Missing .html file extension when prerendering on Verecel
Missing .html file extension when prerendering on Vercel
May 25, 2025
Describe the bug
When using the static adapter and prerendering the entire site, building on my local machine generates files with the
.html
extension for every route. Building on Vercel, however, onlyindex.html
has the.html
extension. The other routes are missing an extension.Vercel manages to resolve requests to those files even without the extension. However, the issue is with a 404 error handling route. To deal with invalid routes on a fully prerendered site, you need to provide a
404.html
file for Vercel to use as a handler. Vercel needs404.html
with that exact name, so without the extension it doesn't work.Furthermore, if you try to rename the route folders to contain the
.html
extension, then Vercel doesn't build them at all.Reproduction
@sveltejs/adapter-static
./routes/+layout.server.ts
with the contentexport const prerender = true;
.build
When building on my local machine, the result is:
When building on Vercel, the result is:
The expected result is the same as the local build, so the issue is that the
.html
extensions are missing.Now rename the paths to get the following project structure:
When building locally, the result is the same as before.
When building on Vercel, the result is:
The other routes are missing entirely.
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: