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

Confusing warning: "…simply add @storybook/preset-create-react-app to your project." #10213

Closed
techieshark opened this issue Mar 26, 2020 · 5 comments · Fixed by #10225
Closed
Labels
cra Prioritize create-react-app compatibility documentation

Comments

@techieshark
Copy link
Contributor

Describe the bug

After upgrading to Storybook 5.3.17, I ran 'yarn storybook' and see the following warning:

WARN Storybook support for Create React App is now a separate preset.
WARN To get started with the new preset, simply add `@storybook/preset-create-react-app` to your project.
WARN The built-in preset will be disabled in Storybook 6.0.

This is confusing, because I have "@storybook/preset-create-react-app" in my package.json.

To Reproduce
Steps to reproduce the behavior:

  1. Create storybook react project or upgrade one to 5.3.17.
  2. Run 'yarn start-storybook`.
  3. Observe warning.

Expected behavior

A warning explaining more than "simply add @storybook/preset-create-react-app to your project.'".

(Sidenote: searching the codebase for 'simply add', I ran across "simply add" as an example of "bad documentation").

I was confused for quite a while because I thought I needed to only add it to package.json.

It seems I actually am supposed to add it to the list of addons in ./storybook/main.js:

module.exports = {
  stories: ['../**/*.stories.js'],
  addons:
  [
    '@storybook/preset-create-react-app',
  ...
 ]

(Adding it has made the warning go away.)

Screenshots
image

Code snippets
Appears the message comes from here:

'To get started with the new preset, simply add `@storybook/preset-create-react-app` to your project.'

@shilman shilman added cra Prioritize create-react-app compatibility documentation labels Mar 26, 2020
@shilman
Copy link
Member

shilman commented Mar 26, 2020

@techieshark any chance you can contribute a PR to fix it?

techieshark added a commit to techieshark/storybook that referenced this issue Mar 27, 2020
@techieshark
Copy link
Contributor Author

@shilman yep done! Thanks : )

@jeremyzilar
Copy link

Do you need to add @storybook/preset-create-react-app to your project even if you're not using create react app?

@umarmw
Copy link

umarmw commented Mar 21, 2022

@jeremyzilar, the same question that I'm asking as it makes no sense to me.

@its-miller-time
Copy link

+1 for @jeremyzilar quesion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cra Prioritize create-react-app compatibility documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants