fix: pass --conditions as argv when relaunching the dev CLI - #15435
Open
official-burak wants to merge 2 commits into
Open
fix: pass --conditions as argv when relaunching the dev CLI#15435official-burak wants to merge 2 commits into
official-burak wants to merge 2 commits into
Conversation
Bun ignores --conditions in NODE_OPTIONS, so the 8.3.0 restart looped and threw. Put the flag on argv instead, which both Node and Bun honor.
official-burak
force-pushed
the
fix/restart-conditions-argv
branch
from
August 25, 2026 17:39
f29d94d to
e599015
Compare
Chromium CI expected one relaunch, but restartCount still looked for NODE_OPTIONS and stayed at 0 after the server started.
official-burak
force-pushed
the
fix/restart-conditions-argv
branch
from
August 25, 2026 17:40
e599015 to
95f74b5
Compare
Author
|
Pushed 95f74b5 for the Chromium failure on
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15433
Changelog
react-router devrelaunches itself with--conditions=developmentso the packageimportsmap resolves the development build. Since 8.3.0 that relaunch put the flag inNODE_OPTIONS. Node honors that. Bun does not: it keeps the env var but never applies--conditions, so#development-condition-enabledstays false,dev()restarts a second time, and the already-restarted guard throws.Description
Pass the extra flags on argv immediately after the runtime binary (
node --conditions=development …/bun --conditions=development …) and stop writing them intoNODE_OPTIONS. ExistingNODE_OPTIONSfrom the user are still inherited. The already-restarted guard is unchanged.Test evidence
Fail-then-pass on
packages/react-router-dev/__tests__/restart-with-conditions-test.ts:--conditionsflag; it was merged intoNODE_OPTIONS--conditions=developmentisargs[0]; callerNODE_OPTIONSis left alonepnpm test packages/react-router-dev/: 10 suites, 190 tests passed.Local Bun check matching the issue:
NODE_OPTIONS=--conditions=development bun --bunleaves the flag in the environment but not inprocess.execArgv.bun --bun --conditions=developmentputs it onexecArgv.