Replies: 1 comment
-
|
This is a fair point. When spawning child Bun processes, the inspector should auto-increment ports. Current workaround: # Parent process
BUN_OPTIONS="--inspect=6499" bun parent.ts
# In parent.ts, spawn child with different port
Bun.spawn(["bun", "--inspect=6500", "child.ts"]);Or dynamically: const parentPort = 6499;
const childPort = parentPort + 1;
Bun.spawn(["bun", `--inspect=${childPort}`, "child.ts"], {
env: {
...process.env,
BUN_OPTIONS: `--inspect=${childPort}`,
},
});Better solution (feature request): Or support port 0 to auto-assign: BUN_OPTIONS="--inspect=0" bun script.ts
# Outputs: Listening on ws://localhost:54321/xxx |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The inspector should choose next available port.
Beta Was this translation helpful? Give feedback.
All reactions