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

Stories not loaded for new generated react native application by expo cli. #91

Closed
igorgidea opened this issue Jul 24, 2020 · 3 comments
Closed

Comments

@igorgidea
Copy link

Describe the bug
After adding storybook for new expo react-native blank project and run command "npm run storybook", browser opens up but no stories displayed at all, only "forever stories loading" on the left panel.

To Reproduce
Steps to reproduce the behavior:

  1. create new react-native project with expo run: expo init myNewProject
  2. Setup React Native Storybook run command: npx -p @storybook/cli sb init --type react_native
  3. Replace content of App.js with these lines:
 import StorybookUI from './storybook';
export default StorybookUI;
  1. Run Storybook by command: npm run storybook

Expected behavior
Should be displayed stories on left sidebar in browser.

Screenshots
изображение

System:
Windows 10
node 12.18.0
Storybook 5.3.19
expo 38.0.8
In browser Google Chrome 84.0.4147.8 or Firefox 78.0.2 there is "forever stories loading" on the left panel

@shilman shilman transferred this issue from storybookjs/storybook Aug 9, 2020
@dannyhw
Copy link
Member

dannyhw commented Aug 11, 2020

might be a duplicate of #55

@dannyhw
Copy link
Member

dannyhw commented Aug 18, 2020

You should run storybook server and then after run the react native app then if you refresh the webpage for react native server the stories should load.

@dannyhw
Copy link
Member

dannyhw commented Sep 6, 2020

I found there is an issue when using a real android device with expo. It can be resolved by specifying your port and host explicitly

When you start up the server you should see something with your IP here
On your network: http://xxx.xxx.x.xx:7007/

Take this IP and set it explicitly as the host and then the storybookui should be able to reach the server

In code

const StorybookUIRoot = getStorybookUI({
  host: "192.111.1.11", // replace with your ip address
  port: "7007"
});

In package.json "storybook": "start-storybook -p 7007 -h 192.111.1.11"

Make sure to replace 192.111.1.11 with your local ip address

This should resolve the connection issues
adb reverse tcp:7007 tcp:7007 also if it still doesn't work

@dannyhw dannyhw closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2023
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

2 participants