Spawn node directly for background dev server on Windows by matthewp · Pull Request #17150 · withastro/astro · GitHub
Skip to content

Spawn node directly for background dev server on Windows#17150

Merged
ematipico merged 1 commit into
mainfrom
windows-background-spawn
Jun 23, 2026
Merged

Spawn node directly for background dev server on Windows#17150
ematipico merged 1 commit into
mainfrom
windows-background-spawn

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Changes

  • Spawns process.execPath (node) directly with node_modules/astro/bin/astro.mjs instead of going through the node_modules/.bin/astro shim. On Windows, npm/pnpm/yarn create .cmd batch file shims in .bin/ that cannot be executed by child_process.spawn() without shell: true, causing spawn() to fail and child.pid to be undefined.

Closes #17146

Testing

  • No new tests. The spawn codepath in background.ts has no integration test coverage on any platform — existing tests only cover pure formatting/parsing helpers.

Docs

  • No docs changes needed. This is an internal bug fix; the --background flag API is unchanged.

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Jun 22, 2026
@matthewp matthewp added the pr preview Apply this label to a PR to generate a preview release label Jun 22, 2026
@github-actions github-actions Bot removed the pr preview Apply this label to a PR to generate a preview release label Jun 22, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 22, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/astro@17150

commit: 5cf6fa0

@codspeed-hq

codspeed-hq Bot commented Jun 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing windows-background-spawn (5cf6fa0) with main (5f2b16b)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (f55ba4c) during the generation of this report, so 5f2b16b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@matthewp matthewp marked this pull request as ready for review June 22, 2026 22:03
@matthewp

Copy link
Copy Markdown
Contributor Author

@ematipico ematipico merged commit 1a61386 into main Jun 23, 2026
31 checks passed
@ematipico ematipico deleted the windows-background-spawn branch June 23, 2026 05:28
@astrobot-houston astrobot-houston mentioned this pull request Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[7.x] "astro dev --background" fails on Windows

2 participants