Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data loaders returns 404 when having optional parameters #138

Open
joeykamsteeg opened this issue Oct 28, 2024 · 1 comment
Open

Data loaders returns 404 when having optional parameters #138

joeykamsteeg opened this issue Oct 28, 2024 · 1 comment

Comments

@joeykamsteeg
Copy link

joeykamsteeg commented Oct 28, 2024

In the new Remix 2.13.1 with the Single Fetch feature enabled, Vercel does not recognize data loader calls during page navigation when using optional parameters. In the screenshot, you can see an example of this issue. The route has an optional parameter lang. In the first call, the en is not present at the beginning of the URL path, and it returns a status 200 with the correct response.

In the second call, the URL path includes a language, such as nl. This results in a 404 status code, and the page content displayed is from Vercel's default 404 page.

image

Live demo instructions:
In the live demo, you can see two navigation buttons at the top left: one for the home page and another for a subpage /brands. On the right, there is a simple language selector that also redirects to the homepage for the selected language. English redirects to '/' and Dutch redirects to '/nl'. There appear to be no issues with navigation when using optional parameters on the index page. However, when switching between the home page and the brands page, an issue happens when you are on /nl.

This issue only occurs when clicking the links on the page; it works fine when you navigate directly to the URL.

Repo:
https://github.com/joeykamsteeg/vercel-single-fetch-optional-route-issue

Live Demo:
https://vercel-single-fetch-optional-route-issue.vercel.app

@joeykamsteeg
Copy link
Author

I think that when this issue is resolved, it will also impact #129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant