Skip to content

The agent that grows with you

fix(desktop): windows-safe spawn + surface spawn errors in the shard runner

kshitijc896c09c4291
diff --git a/apps/desktop/scripts/run-ui-shard.mjs b/apps/desktop/scripts/run-ui-shard.mjs
index cd18f1fb937..8f29f16f62b 100644
--- a/apps/desktop/scripts/run-ui-shard.mjs
+++ b/apps/desktop/scripts/run-ui-shard.mjs
@@ -48,9 +48,14 @@ if (counts.size !== 1 || indices.length !== count || indices.some((v, i) => v !=
}
// Delegate through test:ui so the vitest command stays single-sourced.
+// npm resolves to npm.cmd on Windows, which needs a shell (same handling as
+// test-desktop.mjs and stage-native-deps.mjs).
const result = spawnSync(
'npm',
['run', 'test:ui', '--', `--shard=${index}/${count}`, ...process.argv.slice(2)],
- { stdio: 'inherit', cwd: pkgDir },
+ { stdio: 'inherit', cwd: pkgDir, shell: process.platform === 'win32' },
)
+if (result.error) {
+ console.error(`run-ui-shard: ${result.error.message}`)
+}
process.exit(result.status ?? 1)