Skip to content

Conversation

RFCreate
Copy link

This PR moves the loadDotEnv function prior to configuring the routes.

Why is this important?

I have another project where routes are dynamically generated based on the value of a VITE_* variable, but when running react-router dev, I always get undefined unless I restart manually.

image

This PR removes the need for restarting manually every time.

Copy link

changeset-bot bot commented Oct 13, 2025

⚠️ No Changeset found

Latest commit: 430c5cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Oct 13, 2025

Hi @RFCreate,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Oct 13, 2025

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@timdorr
Copy link
Member

timdorr commented Oct 13, 2025

Could you remove the upgrades to Vite in the package.json files? You only need to upgrade with pnpm, because that version selector will include 6.3.0.

@RFCreate
Copy link
Author

I would rather not touch versions but pnpm keeps resolving Vite to version 6.2.5 which will fail in the integration test.

@RFCreate
Copy link
Author

You can see that with Vite version 6.2.7 (latest in 6.2.x) the variable does not even appear after restarting.

image

@timdorr is there a reason for not moving Vite to ^6.3.0?

@timdorr
Copy link
Member

timdorr commented Oct 14, 2025

No, I was just trying to cut down on noise in the PR so the change is more visible.

@RFCreate
Copy link
Author

The only thing I could think of is to reorder the commits so that the last two are the important ones.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants