Open paulrosen opened 3 months ago
Disclaimer This information might be inaccurate, due to it being generated automatically
The error spawn xdg-open ENOENT
indicates that the xdg-open
command is missing in your Docker container. This command is used to open URLs in the default web browser on Linux systems. To resolve this issue, you need to install the xdg-utils
package in your Docker container. Update your Dockerfile as follows:
FROM node:20.14.0
RUN apt-get update && apt-get install -y xdg-utils
RUN npm install -g nodemon
RUN npm install -g npm@10.8.2
RUN mkdir /srv/app && chown node:node /srv/app
WORKDIR /srv/app
This will ensure that the xdg-open
command is available when Storybook tries to open the URL.
/code/core/src/server-errors.ts /code/lib/cli/src/upgrade.test.ts /code/lib/cli/src/automigrate/fixes/vue3.ts /code/lib/cli/src/automigrate/index.test.ts /code/frameworks/ember/package.json /code/lib/cli/src/automigrate/fixes/addon-postcss.ts /code/lib/cli/src/automigrate/fixes/cra5.ts /code/lib/cli/src/automigrate/fixes/new-frameworks.ts /.github/comments/invalid-link.md /.github/DISCUSSION_TEMPLATE/help.yml /code/lib/cli/src/automigrate/fixes/prompt-remove-react.ts /code/lib/cli/src/automigrate/fixes/upgrade-storybook-related-dependencies.ts /docs/addons/addon-migration-guide.mdx /code/lib/cli/src/automigrate/fixes/mdx-1-to-3.ts /CONTRIBUTING.md /docs/migration-guide/from-older-version.mdx /.github/DISCUSSION_TEMPLATE/ideas.yml /code/addons/onboarding/package.json /code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.ts /docs/_snippets/custom-build-script-production.md /docs/_snippets/test-runner-eject-config.md /test-storybooks/portable-stories-kitchen-sink/vue3/cypress /code/lib/cli/src/automigrate/fixes/missing-storybook-dependencies.ts /code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.test.ts /docs/_snippets/test-runner-with-deploy-event-workflow.md
The robot suggestion above got rid of the error. I ran into another error after that, but it is probably a different issue and I'll report that separately if I can't figure it out.
I experience exactly the same error with exactly the same setup. I noticed it happens only inside of a docker container. When I run the storybook
command outside of the container (M1 Mac, macOS Sonoma 14.5) it works seamlessly.
It's been running ok for a day now, so the answer does seem to be to change my docker file to this:
FROM node:20.14.0
RUN apt-get update
RUN apt-get install -y xdg-utils # For Storybook
RUN npm install -g nodemon
RUN npm install -g npm@10.8.2
RUN mkdir /srv/app && chown node:node /srv/app
WORKDIR /srv/app
I don't know if there is a way to make the error message clearer or to add something to the docs.
I tried with another version of Node, 18.19.0, but there still was the same error. I suppose the error isn't caused by Node itself but rather there's a regression in Storybook v8.
Bot's suggestion seems to solve the problem inside of a docker container though.
I have the same issue on a Toolbx container when trying to run yarn storybook
after upgrading it.
This seems to be because Storybook tries to open the browser when starting its server. You can try with the option --no-open
; it solved the issue for me.
@RomainMorlevat yeah it actually seems to solve the problem.
So with --no-open
option those two lines are obsolete in a Dockerfile for Storybook:
RUN apt-get update
RUN apt-get install -y xdg-utils # For Storybook
Describe the bug
I discovered this problem when upgrading Storybook to
8.2.6
. I had been happily using storybook for a couple years in this app.I decided to create a completely new app as a minimal test and I get the same error.
A summary of what i did: 1) started a docker container 2) created a Vue app using the recommended Vue instructions 3) added Storybook using the recommended instructions Result: an error when attempting to start Storybook.
(The reproduction link field doesn't make sense in this case because this happens purely on the command line as storybook starts.)
Reproduction link
https://github.com/storybookjs/storybook/issues/new
Reproduction steps
My Docker file is:
This is the entire command line of what happened:
System
Additional context
No response