Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open Storybook automatically in the browser #9681

Closed
ofirrifo opened this issue Apr 5, 2022 · 8 comments · Fixed by #9827
Closed

open Storybook automatically in the browser #9681

ofirrifo opened this issue Apr 5, 2022 · 8 comments · Fixed by #9827
Assignees
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: enhancement

Comments

@ofirrifo
Copy link

ofirrifo commented Apr 5, 2022

Current Behavior

I'm using NX with react project and storybook.
When I'm running this command nx run project-name:storybook I would expected to open the browser automatically
or alternatively use any like given by the storybook options https://storybook.js.org/docs/react/api/cli-options

Expected Behavior

open Storybook automatically in the browser

Steps to Reproduce

  • Create a new NX react Lib
  • Add storybook to the lib
  • Run Storybook

Environment

Node : 16.10.0
OS : darwin x64
npm : 7.10.0

nx : 13.9.4
@nrwl/angular : undefined
@nrwl/cypress : 13.9.4
@nrwl/detox : undefined
@nrwl/devkit : 13.9.4
@nrwl/eslint-plugin-nx : 13.9.4
@nrwl/express : undefined
@nrwl/jest : 13.9.4
@nrwl/js : 13.9.4
@nrwl/linter : 13.9.4
@nrwl/nest : undefined
@nrwl/next : undefined
@nrwl/node : undefined
@nrwl/nx-cloud : undefined
@nrwl/nx-plugin : undefined
@nrwl/react : 13.9.4
@nrwl/react-native : undefined
@nrwl/schematics : undefined
@nrwl/storybook : 13.9.4
@nrwl/web : 13.9.4
@nrwl/workspace : 13.9.4
typescript : 4.5.5
rxjs : 6.6.7

Community plugins:

@AgentEnder AgentEnder added the scope: storybook Issues related to Storybook support in Nx label Apr 5, 2022
@mandarini
Copy link
Member

Linking this here: #7531

@mandarini mandarini self-assigned this Apr 5, 2022
@mandarini
Copy link
Member

I'll also mark this as an enhancement! :)

@mandarini
Copy link
Member

mandarini commented Apr 13, 2022

So, @ofirrifo ! The issue goes a bit deeper than what it seems. To make it work automatically, like Storybook does, it will take some time from us to change some things in the builder, and it's planned to happen sooner than later.

In the meantime, I will push a fix that will work if you pass --open=true or just --open when you're running Storybook. Alternatively, in your project.json, in your storybook target, in the options, you can add open: true.

The reason why right now, even if passing open:true does not work is that we are force-passing ci: true.

I actually debugged this during my last stream, if you care to see the whole debugging process.

mandarini added a commit to mandarini/nx that referenced this issue Apr 13, 2022
@mandarini
Copy link
Member

Also, @ofirrifo , let me know if using --open to make it work should suffice for now and we can close this, until we have the other things lined up.

@ofirrifo
Copy link
Author

@mandarini
Thanks for the help?
I need to update the nx project to latest for test it ?

FrozenPandaz pushed a commit that referenced this issue Apr 19, 2022
@mandarini
Copy link
Member

@ofirrifo yes!

@ofirrifo
Copy link
Author

@mandarini Thanks it work perfect :)

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants