Skip to content

Vite: User-define route export referencing server-only code not working #7864

@akoenig

Description

@akoenig

What version of Remix are you using?

2.2.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. Clone this repository: https://github.com/akoenig/remix-repro-vite-redirect
  2. Open http://localhost:5173
  3. Click on the button "To Onboarding"

In one route, /onboarding, there is a function responsible for constructing its own URL (getUrl). This function gets imported in the index route and used within a redirect. This redirect fails occasionally.

Expected Behavior

The redirect should work always.

Actual Behavior

The redirect works occasionally.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions