Repository navigation
fix(vibe-tests): run pnpm through cmd.exe on Windows in fixture-suite - #5841
Merged
cixzhang merged 1 commit intoSep 3, 2026
Merged
Conversation
pnpm is a .cmd batch file on Windows, which spawnSync can only execute through a shell — a bare 'pnpm' fails with ENOENT (never resolved through PATHEXT) and an explicit 'pnpm.cmd' fails with EINVAL (batch files need a shell even named exactly). Every pnpm call here already passes hardcoded argument literals, never user input, so shelling out via cmd.exe /c directly (rather than spawnSync's shell:true) avoids Node's shell-argument-escaping deprecation warning while fixing the actual crash: workspacePackagePaths threw a confusing 'Cannot read properties of undefined (reading trim)' instead of the real error, because a failed spawn (status: null, error: ENOENT) leaves result.stderr undefined rather than a string. This blocked every commit on Windows once check:fixtures landed in check:repo — verified check:fixtures now passes and the existing fail-first regression test (fixture-suite.test.mjs) covers it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
HelloOjasMutreja
marked this pull request as ready for review
September 1, 2026 20:50
HelloOjasMutreja
requested review from
cixzhang and
imdreamrunner
as code owners
September 1, 2026 20:50
Contributor
PR Analysis Report
No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | View full report |
cixzhang
approved these changes
Sep 3, 2026
cixzhang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this is a clean compatibility fix. The direct cmd.exe invocation matches Node’s documented Windows batch-file path and keeps the shell boundary limited to literal arguments.
[Reviewed by Robohands]
josephfarina
pushed a commit
that referenced
this pull request
Sep 4, 2026
…#5841) pnpm is a .cmd batch file on Windows, which spawnSync can only execute through a shell — a bare 'pnpm' fails with ENOENT (never resolved through PATHEXT) and an explicit 'pnpm.cmd' fails with EINVAL (batch files need a shell even named exactly). Every pnpm call here already passes hardcoded argument literals, never user input, so shelling out via cmd.exe /c directly (rather than spawnSync's shell:true) avoids Node's shell-argument-escaping deprecation warning while fixing the actual crash: workspacePackagePaths threw a confusing 'Cannot read properties of undefined (reading trim)' instead of the real error, because a failed spawn (status: null, error: ENOENT) leaves result.stderr undefined rather than a string. This blocked every commit on Windows once check:fixtures landed in check:repo — verified check:fixtures now passes and the existing fail-first regression test (fixture-suite.test.mjs) covers it.
3 tasks done
cixzhang
pushed a commit
that referenced
this pull request
Nov 11, 2026
* test(cli): run the Core rebuild through cmd.exe on Windows
The node global setup rebuilds a stale Core with execFileSync('pnpm').
On Windows pnpm is a pnpm.cmd batch file, which execFileSync can't start
without a shell, so the setup dies with "spawnSync pnpm ENOENT" and no CLI
test runs whenever Core's sources are newer than its build.
Route the call through cmd.exe /d /s /c on win32, the same way the
vibe-tests helpers do since #5841 and #5843. Every argument is a literal,
so this avoids shell: true and its DEP0190 warning. Other platforms are
unchanged.
* test(cli): keep the Core rebuild to one execFileSync call
doc-loads.test.mjs lists each file's child_process sites, and the
platform branch had made two. Pick the executable and its arguments by
platform and keep the single call.
* chore(changeset): note the Windows Core rebuild in the CLI release
ensure-core-built.mjs ships in the @astryxdesign/cli tarball, so the
change needs a CLI patch changeset, as #8567's did for this helper.
This branch was successfully deployed
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.
Problem
internal/vibe-tests/src/fixture-suite.mjscallsspawnSync('pnpm', ...)in two places (workspacePackagePaths, and thepnpm install/typecheck/buildcalls inbuildFixture). On Windows,pnpmis a.cmdbatch file, andspawnSynccan only execute a batch file through a shell:'pnpm'fails withENOENT— Node never resolves it throughPATHEXTwithout a shell.'pnpm.cmd'still fails, withEINVAL— batch files need a shell even called by their exact name.Since a failed spawn (
status: null,error: ENOENT) leavesresult.stderrasundefinedrather than a string, the actual failure was masked by a confusing second crash:TypeError: Cannot read properties of undefined (reading 'trim').This blocks
check:fixtures(recently added tocheck:repo, which runs on everypnpm check:repoand in the pre-commit hook vialint-staged/husky) on Windows entirely — every commit fails at this step regardless of what it touches.Fix
Added a
spawnPnpmSync(args, options)helper: shells throughcmd.exe /d /s /c pnpm ...onwin32, callspnpmdirectly elsewhere. Every call site here passes hardcoded argument literals, never user input, so this avoids Node'sDEP0190shell-argument-escaping deprecation warning that plainspawnSync(..., {shell: true})would otherwise emit on every run.Also hardened the error-message fallback (
result.stderr ?? result.error?.message ?? '') so a genuine future spawn failure reports the real error instead of crashing on.trim().Testing
node internal/vibe-tests/scripts/fixture-suite.mjs verify— passes cleanly (previously crashed) with no deprecation warnings.internal/vibe-tests/src/fixture-suite.test.mjs's existingvalidates provenance, manifests, hashes, package pins, and isolationtest (which callsvalidateCanonicalSuite(), exercising the crashing path) fails against the unfixed source with the exact reported symptom, and passes with the fix — no new test needed, this one already covers it.npx vitest run internal/vibe-tests/src/fixture-suite.test.mjs— 21/21 pass.This file is excluded from the main eslint config (
.mjsoutsidepackages/cli), so no lint step applies.Found while investigating an unrelated PR — noticed the same unguarded
spawnSync('pnpm', ...)pattern also exists infixture-browser.mjsandsetup-test/run-setup.mjs; flagging that separately rather than expanding this PR's scope.