-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Bundled Android application is not connecting to Web Socket server #5435
Comments
Hey, have you tried to explicitly pass host to the storybookUI? The host order in prieview is: const host = params.host || parse(NativeModules.SourceCode.scriptURL).hostname || 'localhost'; So maybe parse(NativeModules.SourceCode.scriptURL).hostname returns something that isn't correct. |
@Gongregyes, for android putting "localhost" explicitly, does not help. As a workaround I've used 10.0.2.2 which helped. PS. NativeModules.SourceCode.scriptURL this returns http://index.android.bundle:7007 |
Hey I never use android emulator, but that seems to be react native / android emulator issue. Have you tried to use host: localhost and then do "adb reverse tcp:7007 tcp:7007"? |
Regarding: NativeModules.SourceCode.scriptURL this returns http://index.android.bundle:7007 We should probably do something about it. |
Sure. It is just port redirection. If you try to open http://localhost:7007 from the emulator's browser it is not working. In a case when JS bundle is managed by Metro bundler, simulator proper responds on localhost:7007. |
Sorry accidentally closed |
Hello, I have been investigating it, and I have found this PR #1568 but as we can see is not working in all the scenarios. Maybe we should check if the bundle is or isn't inside, and then have different approaches. Thanks |
Hey @fjtrujy, the reason for that was: Most CRNA users will tend to run on the phone, not emulator, and the phone can't reach the PC on localhost, leading to storybook not working when following the hello world tutorial (btw this "host" should rather be in hello world readme) I guess there are other solutions for this. |
Thanks for your reply @Gongreg, but maybe I didn't explain properly. As you know, we can execute Storybook in a Physical Device, having the bundle either in the machine or included in the APK/IPA. If I'm not wrong, when you are installing in the specific device you must provide the URL for the host where you are executing the server. So, the current approach won't work either if you want to install the Storybook in a Physical device with the JS bundle inside of the APK/IPA, and then start the server in a different machine (obviously) to change the stories. My initial suggestion was, that maybe we should check if the bundle is inside or outside, in order to use or not use Thanks |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
Describe the bug
The main actors are React Native android application and Storybook WebSocket server.
When the application is not containing JS bundle it successfully connects to local WebSocket server and shares stories to WebSocket server. In the case when the application is bundled with JS inside, it does not connect to the WebSocket server.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Storybook web page should contain all stories added to Android application.
System:
The text was updated successfully, but these errors were encountered: