adapters icon indicating copy to clipboard operation
adapters copied to clipboard

404 no longer sends slug and redirects ending in / no longer work

Open disrae opened this issue 1 year ago • 0 comments

Astro Info

astro info
Astro                    v4.1.2
Node                     v20.10.0
System                   macOS (arm64)
Package Manager          unknown
Output                   hybrid
Adapter                  @astrojs/vercel
Integrations             @astrojs/tailwind

However, npm list shows the latest version of astro installed in the project.
npm list
[email protected] /.../404-issues
├── @astrojs/[email protected]
├── @astrojs/[email protected]
├── @astrojs/[email protected]
├── [email protected] <--- doesn't match astro info
├── [email protected]
└── [email protected]

Describe the Bug

As of late, the vercel adapter no longer passes the slug information to the 404 page, and slugs that need to be redirected that end in a '/' cause a 404 instead of being redirected. Notice that a path of /en/ fails to redirect.

What's the expected result?

Previously, 404 pages had the slug so I could get the locale and have the correct assets and language. Previously, redirects to pages ending in a slash were working, for example: /en/ successfully redirected to /en-ca/, but now it returns a 404.

Here is a repo with a reproduction: https://github.com/disrae/astro-404-and-redirects-errors

Link to Minimal Reproducible Example

https://astro-404-and-redirects-errors-git-main-disraes-projects.vercel.app/

Participation

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

disrae avatar Oct 04 '24 21:10 disrae