-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Description
Describe the bug
Since upgrading to v10, Storybook is crashing on startup:
node:events:486
throw er; // Unhandled 'error' event
^
Error: spawn xdg-open ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:292:12)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn xdg-open',
path: 'xdg-open',
spawnargs: [ 'http://localhost:6022/' ]
I can work around it with --no-open, but ideally that wouldn't be necessary.
What I've managed to work out so far:
- My
$BROWSERvalue points to a shell script (ends with.sh), so$BROWSER http://localhost:6022/opens the local browser. xdg-openis not available in default container images. I could install it in our images, but that's a lot of bloat just to open a browser.- v10 did change the browser opening code. It looks like the value of
$BROWSERis ignored unless it ends with.js, which ours does not. - When I compared this to the Vite browser opening code, which works fine for us, I found it also has a
.jsextension check. So I can't actually explain the difference in behaviour.
Reproduction link
Just use storybook.new, then open in Codespaces (or any environment with $BROWSER pointing to a shell script and xdg-open not installed).
Reproduction steps
No response
System
System:
OS: Linux 6.8 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (4) x64 AMD EPYC 7763 64-Core Processor
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.11.0 - ~/.volta/tools/image/node/24.11.0/bin/node
Yarn: 4.9.4 - ~/.volta/tools/image/yarn/4.9.4/bin/yarn
npm: 11.6.1 - ~/.volta/tools/image/node/24.11.0/bin/npm
pnpm: 10.20.0 - ~/.volta/tools/image/pnpm/10.20.0/bin/pnpm <----- active
npmPackages:
@storybook/addon-a11y: catalog: => 10.0.2
@storybook/addon-docs: catalog: => 10.0.2
@storybook/addon-vitest: catalog: => 10.0.2
@storybook/react-vite: catalog: => 10.0.2
storybook: catalog: => 10.0.2Additional context
No response
dosubot and bryanjtc