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

mark babel-loader as a dependency #4116

Closed
trippingtarballs opened this issue Sep 4, 2018 · 6 comments
Closed

mark babel-loader as a dependency #4116

trippingtarballs opened this issue Sep 4, 2018 · 6 comments

Comments

@trippingtarballs
Copy link

According to the instructions to stand-up a Storybook React project all one need to do, from within their project;

$ npm i --save-dev @storybook/react

However, as see in the source for the package.json of @storybook/react (extract below), the need for babel-loader is marked as a peerDependencies. As in, the consumer of @storybook/react must provide their preferred version of babel-loader.

  },
  "peerDependencies": {
    "babel-loader": "^7.0.0 || ^8.0.0 || ^8.0.0-beta.6",
    "react": ">=15.0.0",
    "react-dom": ">=15.0.0"
  }

However, without babel-loader installed by the consumer, and with @storybook/react installed in their React project, the following babel error is returned when attempting to invoke start-storybook;

Module not found: Error: Can't resolve 'babel-loader' in ...

Either the installation instructions for @storybook/react should include babel-loader as an additional dependency, or babel-loader should be listed in the dependencies section of the package.json for the @storybook/react project.

@Hypnosphi
Copy link
Member

Hypnosphi commented Sep 4, 2018

Yes, we need to update those instructions. If you'd like to open a PR, please refer to https://github.com/storybooks/storybook/blob/master/MIGRATION.md#babel-7

@ndelangen
Copy link
Member

Hey @trippingtarballs would you be able to open a PR to fix? 🙇

@annezhou920
Copy link
Contributor

@ndelangen I can take this on if @trippingtarballs haven't had the chance to.

Should I update the instructions to say Add react, react-dom, babel-core, and babel-loader and include npm i --save-dev babel-loader@7?
https://github.com/storybooks/storybook/blob/v4.0.0-alpha.20/docs/src/pages/basics/guide-react/index.md#add-react-react-dom-and-babel-core

@ndelangen
Copy link
Member

@annezhou920
Copy link
Contributor

annezhou920 commented Oct 12, 2018

@ndelangen it'll be my first time making a PR for the OSS community. i have a branch ready to be pushed up but i'm getting permission errors. do i need to have permission to push up to the repo?

nvm! i figured i had to make a fork...i'm a noob at this 😆

@ndelangen
Copy link
Member

@annezhou920 happy to welcome you into the OSS community! You're doing great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants