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.

@changeset-bot
Copy link

changeset-bot bot commented Oct 13, 2025

🦋 Changeset detected

Latest commit: e90e41c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Major
@react-router/fs-routes Major
@react-router/remix-routes-option-adapter Major
create-react-router Major
react-router Major
react-router-dom Major
@react-router/architect Major
@react-router/cloudflare Major
@react-router/express Major
@react-router/node Major
@react-router/serve Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another 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 hello@remix.run.

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.

@RFCreate
Copy link
Author

RFCreate commented Oct 21, 2025

Had to resolve the merge conflicts.

@RFCreate
Copy link
Author

@brophdawg11 Sorry for the ping, is there something missing?

@RFCreate RFCreate force-pushed the dev branch 4 times, most recently from e60d82b to 39a5b03 Compare November 22, 2025 03:25
@RFCreate
Copy link
Author

I added a changeset just in case, apart from that everything is the same.

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