After running getstorybook and yarn run storybook im getting the following error:

These are de react versions I use:
"react": "16.0.0-alpha.12",
"react-native": "0.48.4",
Node : 8.5.0
try react@16 and [email protected]. I think you also need an index.js file instead of the index.ios.js and index.android.js with the recent changes.
@danielduan thanks for the tip. It now starts the app successfully but for some reason storybook wont start on the simulator. The app is just start as usual when using react-native start
The steps I follow:
yarn run storybook -- --reset-cachereact-native run-iosThe app does build and the packer does not give errors but the storybook is not loaded but the usual app
If you aren't running the CRNA version, you have to manually comment out your index.js or index.ios/android.js and paste in this:
import Storybook from './storybook';
export default Storybook;
Make sure the App.json has the same name and displayName as the index from ./storybook that you are importing.
Solved the issue! I had to make two changes
Renaming './storybook/index.ios.js' to './storybook/index.js' and removing './storybook/index.android.js'
The appKey of the app itself was 'Logistiek' whereas the appKey in 'storybook.js' was 'logistiek'. By renaming 'Logistiek' to 'logistiek' everything went OK. For people having the same issue the appKey is being set with the first argument of the 'registerComponent' method
AppRegistry.registerComponent('logistiek', () => StorybookUI);
I fixed using the following. (you can try in reverse order, one of these might work for you beforehand)
I'm on windows 10:
cd (change directory) to my project folder.cd android and then gradlew cleancd .. back to project foldernpm installyarn installreact-native run-android. This should run on emulator fail with cannot connect. cd to project folder.npm run storybook check that runs ok by opening `localhost:7007' in the browserNote: If I run storybook in the separate window, before I run-android, I get the cannot connect to app or the not registered.
My package.json has this in the scripts tag:
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"storybook": "storybook start -p 7007"
},
My App.js looks like this:
import { YellowBox } from 'react-native';
import StorybookUI from './storybook';
import AppRedux from './AppRedux';
YellowBox.ignoreWarnings([
'Warning: isMounted(...) is deprecated',
'Module RCTImageLoader'
]);
// This will load StorybookUI on Dev and App in Release
module.exports = __DEV__ ? StorybookUI : AppRedux;
// module.exports = AppRedux;
What worked for me was:
stop all Metro Bundler's instances and run the app again.
Most helpful comment
Solved the issue! I had to make two changes
Renaming './storybook/index.ios.js' to './storybook/index.js' and removing './storybook/index.android.js'
The appKey of the app itself was 'Logistiek' whereas the appKey in 'storybook.js' was 'logistiek'. By renaming 'Logistiek' to 'logistiek' everything went OK. For people having the same issue the appKey is being set with the first argument of the 'registerComponent' method