SvelteKit ISR + Paraglide JS Localized Routes Return 404 on Vercel

Environment

  • Framework: SvelteKit

  • Adapter: @sveltejs/adapter-vercel

  • i18n Library: Paraglide JS (@inlang/paraglide-sveltekit)

  • Locales: en, ckb (path-based, e.g., /en/isr, /ckb/isr)

  • Hosting: Vercel

Problem

ISR (Incremental Static Regeneration) works for the base route /isr, but all localized routes (/en/isr, /ckb/isr) return 404 Not Found on Vercel. Everything works correctly in local development.

Repo

https://github.com/d1d4r/isr-sveltekit

https://isr-sveltekit.vercel.app/ckb/isr

What Works

  • :white_check_mark: /isr — works and caches correctly

  • :white_check_mark: Local development — all localized routes work

What Doesn’t Work

  • :cross_mark: /en/isr — returns 404 on Vercel

  • :cross_mark: /ckb/isr — returns 404 on Vercel

Root Cause Analysis

Vercel’s ISR operates at the edge layer, which runs before SvelteKit’s reroute hook processes the request. When a request comes in for /en/isr:

  1. Vercel’s edge looks for a cached ISR page at /en/isr

  2. No cache exists (ISR config only exists for /isr)

  3. Returns 404 before SvelteKit’s reroute can map /en/isr/isr

Solutions Attempted

Attempt Result
Changed expiration: false to expiration: 60 Still 404
Added vercel.json rewrites for locale paths Routes work but locale detection breaks (always defaults to en)
Using [lang] dynamic route segment Not compatible with Paraglide’s architecture

Expected Behavior

Localized routes (/en/isr, /ckb/isr) should work with ISR, respecting SvelteKit’s reroute hook to map them to the underlying /isr route while maintaining correct locale context.

Question

How can ISR be configured to work with Paraglide JS’s middleware-based rerouting approach on Vercel? Is there a way to make Vercel’s edge layer aware of the rerouted paths, or a recommended pattern for this use case?

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.