Skip to content

API Route always returns 404 on Vercel depending on trailingSlash #9206

@florian-lefebvre

Description

@florian-lefebvre

Astro Info

Astro                    v3.6.1
Node                     v18.14.1
System                   Windows (x64)
Package Manager          yarn
Output                   hybrid
Adapter                  @astrojs/vercel/serverless
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When setting trailingSlash in both astro and vercel configs, I think there is some conflict that causes API routes to always be 404.

What's the expected result?

The route /api/test/ should return some json. Here is the deployment: https://astro-vercel-endpoint-issue.vercel.app/api/test/

Link to Minimal Reproducible Example

https://github.com/florian-lefebvre/astro-vercel-endpoint-issue

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)feat: ssrRelated to SSR (scope)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions