infinitered / ignite-andross

The original React Native boilerplate from Infinite Red - Redux, React Navigation, & more
https://infinite.red/ignite
MIT License
475 stars 150 forks source link

Failed to load bundle Storybook #259

Open oktalk opened 5 years ago

oktalk commented 5 years ago

I'm running into an issue with Storybook. Starting with a fresh install, running yarn storybook the build fails (truncated error log below). I was able to move on by following this thread: https://github.com/storybooks/storybook/issues/4179

Updating my package.json to "storybook": "storybook start -p 7007 --skip-packager | react-native start --projectRoot storybook" is working for now.

...
yarn run v1.15.2
$ storybook start -p 7007
=> Loading custom .babelrc from project directory.
=> Loading custom addons config.
=> Using default webpack setup based on "Create React App".
Scanning 1199 folders for symlinks in /Users/me/Development/projects/andross/node_modules (13ms)

React Native Storybook started on => http://localhost:7007/

error: unknown option `--projectRoots'
webpack built ab3d4c1e339e0b94f5e7 in 2675ms
Hash: ab3d4c1e339e0b94f5e7
Version: webpack 3.12.0
Time: 2675ms
...
...
ERROR in ./storybook/addons.js
Module build failed: Error: Couldn't find preset "module:metro-react-native-babel-preset" relative to directory "/Users/me/Development/projects/andross/storybook"
...
kerematam commented 5 years ago

I had same issue. I've solved by updating babel-core to 7.0.0-bridge.0 and use storybookSwitcher function for relaying storybook to UI.

In App.js file :

export default DebugConfig.useReactotron
  ? console.tron.storybookSwitcher(StorybookUI)(App)
  : App

Using storybookSwitcher function is not directly about your issue but anyway. This is how make storybook up and running after fresh install of Ignite Andross.