Skip to content

Commit

Permalink
fix(@react-router/dev): prevent argv parsing crash when optionnal arg…
Browse files Browse the repository at this point in the history
…s are passed to the cli (#12609)
  • Loading branch information
PhilDL authored and timdorr committed Dec 21, 2024
1 parent 329fc0a commit 5c8ffd8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pretty-clouds-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-router/dev": patch
---

Fix for a crash when optional args are passed to the CLI
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
- pavsoldatov
- pcattori
- petersendidit
- phildl
- pierophp
- printfn
- promet99
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dev/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let arg = require("arg");
// default `NODE_ENV` so React loads the proper version in it's CJS entry script.
// We have to do this before importing `run.ts` since that is what imports
// `react` (indirectly via `react-router`)
let args = arg({}, { argv: process.argv.slice(2) });
let args = arg({}, { argv: process.argv.slice(2), stopAtPositional: true });
if (args._[0] === "dev") {
process.env.NODE_ENV = process.env.NODE_ENV ?? "development";
} else {
Expand Down

0 comments on commit 5c8ffd8

Please sign in to comment.