kit icon indicating copy to clipboard operation
kit copied to clipboard

`reroute` hook breaks when deployed on Vercel if the app is deployed as multiple functions

Open LorisSigrist opened this issue 1 year ago • 0 comments

Describe the bug

An App that's deployed to vercel using @sveltejs/adapter-vercel will break if it is both:

  1. Is using the reroute hook
  2. Is deployed as multiple functions (either large or using split: true)

When hitting a route that should get rerouted, it will instead return a 404.

This has caused the localised routing provided by @inlang/paraglide-js-adapter-sveltekit to break when deployed to Vercel. opral/monorepo#2269

Reproduction

Repo: https://github.com/LorisSigrist/sveltekit-adapter-vercel-rerotute-bug-reproduction Deployment: https://sveltekit-adapter-vercel-rerotute-bug-reproduction.vercel.app/

The route /some-page should get rerouted to /, but isn't in production. Instead a 404 is returned

Logs

No response

System Info

System:
    OS: macOS 14.3.1
    CPU: (14) arm64 Apple M3 Max
    Memory: 2.08 GB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.1 - /opt/homebrew/bin/node
    npm: 10.2.4 - /opt/homebrew/bin/npm
    pnpm: 8.15.3 - /opt/homebrew/bin/pnpm
  Browsers:
    Safari: 17.3.1
  npmPackages:
    @sveltejs/adapter-vercel: ^5.1.0 => 5.1.0 
    @sveltejs/kit: ^2.0.0 => 2.5.0 
    @sveltejs/vite-plugin-svelte: ^3.0.0 => 3.0.2 
    svelte: ^4.2.7 => 4.2.11 
    vite: ^5.0.3 => 5.1.4

Severity

blocking all usage of SvelteKit (on Vercel)

Additional Information

No response

LorisSigrist avatar Feb 21 '24 14:02 LorisSigrist