-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
React Native server stories list infinitely loading #55
Comments
Did you try it?
|
Hi @bouncycatt .. How do you run the story book on the mobile or simulator? I have the same problem on web version and I did follow the tutorial steps but I feel something is missing. |
Hi, I got same problem too. |
@JeffGuKang Thanks. I tried it but the problem is the same. |
@akhudairy Hi! If I'm not mistaken, a Storybook viewer appeared on a device when I tried previous versions of Storybook. Unfortunately, I don't remember. Today I retook all the tutorial steps with |
@akhudairy You have to render the StorybookUIRoot. There's a part in https://storybook.js.org/docs/guides/guide-react-native/ where it says
This component is the "storybook on the mobile". Usually I'd have my entry point index.js's AppRegistry render out this component instead of the app component(using an if conditional check in regards to .env). Some people put it on a different screen in their navigation, etc. |
@bouncycatt I'm using storybook on iOS so I can't comment much but my web storybook always looks like this when my app(on the simulator) does not touch/run the getStorybookUI function. This happened to me initially because I didn't know I had to import and render it somewhere in my app(see the comment I made above). I'm not 100% sure if this is the cause since I don't really know the inner workings on getStorybookUI/ how our app connects to the storybook react-native-server. |
hi @Esxiel ... thanks i will give that ago by adding storybook to my other project using the manual steps. But the idea is I was following the story book official React Native tutorial. and their app.js file looks very different compared to these manual steps ... here is the code they ask you to add // App.js
} catch (e) { |
Um @akhudairy , I might be misunderstanding you, but you are referring to https://www.learnstorybook.com/intro-to-storybook/react-native/en/get-started/ right? You are right in saying that the code in manual steps guide is very different with the App.js in the tutorial, however you'd benefit from understanding a few misconceptions you have...
I apologize to the maintainers for veering off-topic. |
Was anyone able to find a workaround? or the config that is needed to fix this. |
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. |
I have the same issue, but, I resolve that, plz check your rn storybook port and storybook port are the same, in my case, getStorybookUI Options |
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 Take this IP and set it explicitly as the host and then the storybookui should be able to reach the server In code
In package.json This should resolve the connection issues This might also help some people if the above isn't working
|
having the same issue... following the tutorial (twice) exactly as written, and the stories are perpetually loading for react native. React tutorial is working fine. |
@chadmott are you using a simulator or a real device or web? The tutorial is needing some updates so it might not be 100% accurate. Also the auto setup has a bug currently regarding dependency versions. |
@chadmott check your package.json if there are any storybook packages with version 6.0 or above please downgrade them to 5.3.21 since we don't yet support storybook v6 with react native. |
thanks @dannyhw but that did not solve my issue. I'm just trying to learn Storybook (hence the tutorial) so I'm afraid I don't know why its broken. For now I'll just use the react tutorial |
@chadmott the part where it says to use "yarn start" should be "yarn web" that should fix the issue. edit: |
@impactro great to see you were able to get it working :) |
I found the solution. Same problem happened with me. Please start your story book with this argument -> After the server starts, if the browser says "This site can't be reached", for the ip There seems to be some network issue with storybook and it runs only on your localhost if the command Also no need of writing any port or host in Found the major hint in this reply. EDIT 1: |
Omg, I've been banging my head against the wall for hours. I feel like such a dolt. Thank you! |
I did everything above and it is still not working :-/ |
@Yasin-Ali If you share more details I could help you get it working. What's the server command look like in your package.json and the getstorybookui arguments you are using. |
Yes the storybook server is not a web storybook for react native it's just a server for controlling the device. |
Following steps will work in case you are able to load stories on your emulator and control them via on-device navigator, preview and addons and just Advantages:
Steps:
host->
|
please refer above post by @RitikaGupta8734 . its working for me |
Hey wanna ask, do u run your expo on device by scan qr code or connect with cable? Cause now both android, ios I scan with Expo Qr code, both cant connect with storybook. What I have done:
const StorybookUIRoot = getStorybookUI({
host:'173.68.789.25', // this is get bro the Storybook output
port:'7007',
asyncStorage: null
});
Outcome now:
Not sure what happened here 😢 It look likes the Android iOS device cant connect with the Storybook server. Let me know if have any suggestion |
Make sure you aren't connecting over the "tunnel" connection mode in expo, try to use local LAN network option. Also make sure you changed the server port in your package.json to the same as your getStorybookUI one. |
Yes, I use LAN connection, I tried both "Scan QRCode" and also connect with cable.. both cant connect(forever loading in In package.json, this is my script.
Then getStorybookUI is this.
and I also In android device, storybook UI is presented, just cant connect in But still no luck 😢 |
@kenchoong have you tried |
Yes,
run each command after another. What I got now:
Connected using cable and Scan QRcode as well , weird.. |
try changing it to this
I don't think that the port should be a string. |
Yes, this is one of the reason. And state here for future references as well, the reason of this is because |
@dannyhw @kennethtruong WORKED FOR ME! Just needed to add the host and port. What a waste of a day! |
I am still struggling with the sidebar not loading and I have completed everything exactly as explained by @kenchoong. I'm not sure what I would be doing wrong at this point? Does it matter what server expo is running on? |
@jordanlang410 The important thing is having the same ip and port for both the storybook script in package.json and also in getStorybookUI. Also make sure its the right ip address for your machine. It should be the local network address, this ip will be shown when you initially run the server. This solution has been shown to work multiple times so I imagine you just need to double check your setup and double check the IP address. In package.json "storybook": "start-storybook -p 7007 -h 172.1.1.1", and getStorybookUI const StorybookUIRoot = getStorybookUI({ |
add this to your package.json
The value of the host should start with 192, other than that, certainly it is wrong. Restart your computer, and get the new IP. |
I figured it out. I did not follow instructions properly and failed to put the export {default} from './storybook'; into my App.js file. You all rock @kenchoong and @dannyhw. Your earlier posts saved me a ton of time. |
Leaving this here in case it helps anybody. We use the new JSX transform as described here and were facing an infinitely loading sidebar. Setting the |
I'm just locking this to avoid unnecessary noise, I believe that there are already solutions and discussing further isn't necessary. I'll leave the issue open for discoverability and to help others with the same problem. |
as this issue is very old I believe we can close this since the server was completely replaced in v7 |
Hello! I had a problem with loading Storybook web explorer, it doesn't load the left menu. But on a device Storybook works well. I met the problem both during Intro React Native Storybook Tutorial and in my bare workflow project. It just doesn't build a web version.
Steps
In a terminal to a project folder:
npx -p @storybook/cli sb init --type react_native
yarn add -D @storybook/addon-ondevice-actions
In storybook/rn-addons.js
import '@storybook/addon-ondevice-actions/register';
In the terminal I tried this and reverse order:
yarn storybook
yarn start
a
– both Android simulator and a real Android device, Storybook works well on both options but does not in a browser.On
yarn storybook
the answer:From the tutorial it should be this
But I have this result on any projects and environments I tried
Environment Info:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Binaries:
Node: 12.16.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
Browsers:
Chrome: 81.0.4044.138
Firefox: 76.0
Safari: 12.1.2
npmPackages:
@storybook/addon-actions: ^5.3.18 => 5.3.18
@storybook/addon-links: ^5.3.18 => 5.3.18
@storybook/addon-ondevice-actions: ^5.3.18 => 5.3.18
@storybook/addons: ^5.3.18 => 5.3.18
@storybook/react-native: ^5.3.18 => 5.3.18
@storybook/react-native-server: ^5.3.18 => 5.3.18
Also, I tried with the older 5.2.1 Storybook version, an Android simulator, and an Android phone via USB, Ubuntu, manual server setup, but the same error.
I also set up React Storybook Tutorial for a try to see if there is this error there. No problem, all works properly with React.
The text was updated successfully, but these errors were encountered: