Skip to content

fix(miniflare): hide workerd console window on Windows - #14864

Merged
petebacondarwin merged 1 commit into
cloudflare:mainfrom
Hashim1999164:fix/miniflare-windows-hide-workerd
Jul 27, 2026
Merged

fix(miniflare): hide workerd console window on Windows#14864
petebacondarwin merged 1 commit into
cloudflare:mainfrom
Hashim1999164:fix/miniflare-windows-hide-workerd

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #14863.

Summary

Miniflare spawns workerd without windowsHide: true. When the parent Node process has no console (for example a detached or backgrounded process such as Astro's astro dev --background), Windows allocates a new console for workerd.exe. On Windows 11 that console is hosted by Windows Terminal, so a visible, focus-stealing window appears for the lifetime of the runtime.

  • Pass windowsHide: true to the workerd spawn options. This is a no-op on macOS/Linux.

Related: withastro/astro#17516 (detached parent spawn on the Astro side).

Checklist

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: windowsHide is a standard Node spawn option with no effect outside Windows, and verifying the console window requires a Windows 11 host with Windows Terminal as the default console host plus a console-less parent process.
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal spawn option with no user-facing API change.

Made with Cursor


Open in Devin Review

Spawn workerd with windowsHide: true so Windows does not allocate a
new console when the parent process has none. Without this, background
or detached parents (for example Astro's astro dev --background) cause
a visible, focus-stealing Windows Terminal window for workerd.exe.

Fixes cloudflare#14863
@changeset-bot

changeset-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a9dcbec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
miniflare Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod
workers-devprod requested review from a team and penalosa and removed request for a team July 26, 2026 13:24
@workers-devprod

workers-devprod commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14864

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14864

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14864

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14864

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14864

miniflare

npm i https://pkg.pr.new/miniflare@14864

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14864

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14864

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14864

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14864

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14864

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14864

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14864

wrangler

npm i https://pkg.pr.new/wrangler@14864

commit: a9dcbec

@workers-devprod workers-devprod 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.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jul 27, 2026
@petebacondarwin
petebacondarwin removed the request for review from penalosa July 27, 2026 08:59
@petebacondarwin
petebacondarwin enabled auto-merge (squash) July 27, 2026 09:00
@petebacondarwin
petebacondarwin merged commit 3a22ae5 into cloudflare:main Jul 27, 2026
70 of 73 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Windows: workerd.exe opens a visible console window when the parent process has no console (missing windowsHide)

3 participants