Skip to content

Vercel Adapter — Trailing slash option causes redirect loop #12556

@adrienpicard

Description

@adrienpicard

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions