Repository navigation
Description
What version of Bun is running?
1.4.0+34cbb9a40
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What steps can reproduce the bug?
Running bunx oxfmt works but uses node behind the scenes. Adding the --bun option then causes it to fail. Note I've added the --no-install option because the error is different without it and the process seems to hang. To reproduce, you just need a html file to get formatted by oxfmt. In the attached package.json there are two scripts to help demonstrate.
This works:
bun install
bun run fmt:node
This doesn't:
bun install
bun run fmt:node
What is the expected behavior?
Running bunx oxfmt and bunx --bun oxfmt should produce the same output. This does work for ts files, for example, just seems to be related to html ones (potentially others, I've only checked these two types of files)
What do you see instead?
bun run fmt:bun
$ bunx --bun --no-install oxfmt
× Error: Worker exited unexpectedly
│ [index.html]
Error occurred when checking code style in the above files.
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
74 | this.threadId = this.process.pid;
75 | this.process.on("exit", this.onUnexpectedExit);
76 | this.waitForExit = new Promise((r) => this.process.on("exit", r));
77 | }
78 | onUnexpectedExit = () => {
79 | this.process.emit("error", new Error("Worker exited unexpectedly"));
^
error: Worker exited unexpectedly
at onUnexpectedExit (D:\GitHub\bun-oxfmt-error\node_modules\tinypool\dist\index.js:79:34)
at emit (node:events:124:23)
at #handleOnExit (node:child_process:578:14)
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
error: Could not find an existing '' binary to run. Stopping because --no-install was passed.
Bun v1.4.0 (Windows x64)
error: script "fmt:bun" exited with code 1
Additional information
No response
Activity
robobun commentedon Aug 24, 2026
Reproduced on Windows:
bunx --bunboots the bin script inside thebunx.exeprocess, soprocess.execPathpoints atbunx.exeandprocess.execArgvcarries the bunx CLI flags, which breakschild_process.fork()(tinypool, used by oxfmt for HTML).Fix in progress: #40300
bunx: fix process identity when the Windows fast path runs a bin in-p…