Skip to content

Commit de16a18

Browse files
fix: use spread operator to avoid empty string arguments
This fixes the regression introduced in dc5fa6a where empty strings were passed as arguments when no command or args were provided, causing parseArgs to fail with "Unexpected argument ''" error. The spread operator approach is more idiomatic and avoids creating empty strings that need to be filtered out.
1 parent cf44b30 commit de16a18

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/bin/start.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ async function startProdServer(serverOptions) {
9191
"node",
9292
[
9393
inspectorServerPath,
94-
command ? `--command=${command}` : "",
95-
mcpServerArgs && mcpServerArgs.length > 0
96-
? `--args=${mcpServerArgs.join(" ")}`
97-
: "",
94+
...(command ? [`--command=${command}`] : []),
95+
...(mcpServerArgs && mcpServerArgs.length > 0
96+
? [`--args=${mcpServerArgs.join(" ")}`]
97+
: []),
9898
],
9999
{
100100
env: {

0 commit comments

Comments
 (0)