Skip to content

fix(windows): resolve process spawning and path resolution blockers for windows host#1612

Open
micronox wants to merge 1 commit into
BuilderIO:mainfrom
micronox:windows-compat-fixes
Open

fix(windows): resolve process spawning and path resolution blockers for windows host#1612
micronox wants to merge 1 commit into
BuilderIO:mainfrom
micronox:windows-compat-fixes

Conversation

@micronox

Copy link
Copy Markdown

Description

This PR resolves critical blockers preventing the agent-native dev server and UI from building and running on Windows host machines.

Fixes included:

  • Windows process execution: Replaced hardcoded pnpm references with pnpm.cmd in scripts/dev-lazy.ts to allow Windows Node to properly spawn background workers.
  • Spawn EINVAL resolution: Added { shell: true } to the child process spawn configuration in scripts/dev-lazy.ts. Without this, Windows throws an EINVAL crash when trying to execute the background Vite workers.
  • Cross-platform compatibility: Minor syntax corrections to ensure copy operations and pathing in UI package scripts execute cleanly on Windows.

Tested locally on Windows 11. All 12 templates successfully mount and proxy to the 127.0.0.1:8080 gateway after these patches.

…or windows host

Replaced Unix-specific 'pnpm' reference with 'pnpm.cmd', injected shell: true to fix spawn EINVAL, and corrected UI copy syntax to resolve build crashes.
@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Visual recap — skipped

The visual recap job did not run for this pull request. This is informational only and does not block the PR.

Recap skipped for f32bf92: external fork PR requires a maintainer to apply the recap label to the current head SHA.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 3 potential issues 🔴

Review Details

This PR is a small but important infrastructure change aimed at restoring Windows-host compatibility for the lazy dev runner and the code-agents UI package build. The intent is sound: Windows does require different process-launch behavior, and the existing pnpm/spawn assumptions were blocking local development there. Risk assessment: standard because the diff touches shared dev/build tooling that affects local workflows across platforms.

The main concern is that the implementation hardcodes Windows-specific commands instead of selecting them conditionally. In scripts/dev-lazy.ts, replacing pnpm with pnpm.cmd fixes Windows spawning but regresses macOS/Linux, where pnpm.cmd does not exist. Similarly, the package build script now uses copy, which is a Windows shell builtin and fails in POSIX shells. I manually verified both regressions in this Linux review environment.

Key findings

  • 🔴 HIGH: Windows-only pnpm.cmd now breaks non-Windows child process launches
  • 🔴 HIGH: Windows-only copy now breaks non-Windows package builds

The PR is close, but it needs platform-aware command selection or a cross-platform copy mechanism before merge.

🧪 Browser testing: Skipped — PR only modifies backend/config/docs, no UI impact

Comment thread scripts/dev-lazy.ts
Comment on lines +858 to +859
const child = spawn(
"pnpm.cmd",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Hardcoded pnpm.cmd breaks non-Windows app startup

This spawn now uses pnpm.cmd unconditionally, which fixes Windows but fails on macOS/Linux because that executable does not exist there. Pick pnpm.cmd only on Windows and keep pnpm for other platforms.

Additional Info
Found by 2/2 review agents. Manually verified on Linux: `spawnSync('pnpm.cmd', ['--version'])` returns ENOENT; `spawnSync('pnpm.cmd --version', { shell: true })` exits 127 with `/bin/sh: pnpm.cmd: not found`.

Fix in Builder

Comment thread scripts/dev-lazy.ts
Comment on lines 1409 to +1410

startBackgroundProcess("core", "pnpm", [
startBackgroundProcess("core", "pnpm.cmd", [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Background worker launches are now Windows-only

The startBackgroundProcess call sites were also switched to pnpm.cmd, so the core/tray/frame/electron helpers will no longer start on macOS/Linux. Use the same platform-aware binary selection here as in the app spawn path.

Additional Info
Found by 2/2 review agents. `startBackgroundProcess()` itself still uses `shell: process.platform === 'win32'`, so these call sites now point Unix hosts at a nonexistent binary.

Fix in Builder

},
"scripts": {
"build": "tsgo && cp src/styles.css dist/styles.css",
"build": "tsgo && copy src\\styles.css dist\\styles.css",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Build script now uses a Windows-only copy command

copy is a cmd.exe builtin, so this build now fails on macOS/Linux shells. Please switch this step to a cross-platform copy mechanism instead of a Windows-specific command.

Additional Info
Found by 2/2 review agents. Manually verified on Linux with `npm run build --prefix packages/code-agents-ui`, which fails with `sh: 1: copy: not found`.

Fix in Builder

@steve8708

Copy link
Copy Markdown
Contributor

thanks for sending @micronox - some feedback here and CI failures to fix in order to merge

@micronox

Copy link
Copy Markdown
Author

Heya guys, sorry for the mix-up... my first time trying to submit a fix on github. Whats the best way to revoke everything... i can put it on my own fork and not mess up the lanes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants