kit icon indicating copy to clipboard operation
kit copied to clipboard

Vercel Adapter — Trailing slash option causes redirect loop

Open adrienpicard opened this issue 1 year ago • 1 comments

Describe the bug

When requesting a page with export const trailingSlash='always', Vercel returns a 308 Resume Incomplete status. In browser this lead to a ERR_TOO_MANY_REDIRECTS error.

Note that navigating to the page works, but reloading it errors.

Reproduction

Set export const trailingSlash='always' to one of +your-page.server.ts and deploy the app to Vercel using the adapter.

Type https://mysite.vercel.app/your-page/ in your browser and hit Enter.

CleanShot 2024-08-07 at 18 12 01

Logs

No response

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 92.50 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 127.0.6533.90
    Safari: 17.5
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.2.2 
    @sveltejs/adapter-vercel: ^5.2.0 => 5.4.1 
    @sveltejs/kit: ^2.0.0 => 2.5.20 
    @sveltejs/vite-plugin-svelte: ^3.0.0 => 3.1.1 
    svelte: ^4.2.15 => 4.2.18 
    vite: ^5.0.3 => 5.4.0

Severity

serious, but I can work around it

Additional Information

No response

adrienpicard avatar Aug 07 '24 17:08 adrienpicard

Adding repro link: https://kit-isr-demo.vercel.app/about/ and repo: https://github.com/adrienpicard/kit-isr-demo

Note that you can navigate to the About page using link in Menu

  npmPackages:
    @sveltejs/adapter-vercel: ^5.4.3 => 5.4.3 
    @sveltejs/kit: ^2.5.22 => 2.5.22 
    @sveltejs/vite-plugin-svelte: ^3.1.1 => 3.1.1 
    svelte: ^4.2.18 => 4.2.18 

adrienpicard avatar Aug 13 '24 08:08 adrienpicard