Skip to content

Data loaders returns 404 when having optional parameters #138

Description

@joeykamsteeg

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

Activity

joeykamsteeg commented on Oct 28, 2024

@joeykamsteeg
Author

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

styxlab commented on Feb 25, 2025

@styxlab

Looks similar to remix-run#10497.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions