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

Don't work if Debug server host is setted: websocket: connection error", "Failed to connect to localhost/127.0.0.1:7007 #844

Closed
shilman opened this issue Apr 15, 2017 · 10 comments

Comments

@shilman
Copy link
Member

shilman commented Apr 15, 2017

Issue by linonetwo
Saturday Dec 17, 2016 at 07:06 GMT
Originally opened as storybook-eol/react-native-storybook#116


I use wifi to sent bundle, in Dev settings, I set Debug server host to 10.0.0.90:8081, and bundle was sent. But socket seems still try to connecting 127.0.0.1:7007.

I think socket should read Dev setting, and try to connect 10.0.0.90:7007 if I have set it.

Seems running "storybook start -h 10.0.0.90 -p 7007" can't help.

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by linonetwo
Saturday Dec 17, 2016 at 07:20 GMT


Ok, seems using:

const StorybookUI = getStorybookUI({port: 7007, host: '10.0.0.90'});

can do this.

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by linonetwo
Saturday Dec 17, 2016 at 07:21 GMT


But I think it's better to read Dev settings...Since this is config, prefer not hardcoded.

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by linonetwo
Saturday Dec 17, 2016 at 07:30 GMT


Well, after searching. I still don't know how to read Dev settings, or I could have made a PR...

Tell me if anybody know the way to do this.

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by mnmtanish
Monday Dec 19, 2016 at 04:48 GMT


Hi @linonetwo

Thanks for opening the issue. If you find a way to pass some config info into the React Native app at build time without hard coding it, please let me know. So far, the only I way I found is by dynamically generating a JS file when starting storybook and importing it into the RN app. I'm trying to find a better way to do this.

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by DandroidDeveloper
Friday Jan 06, 2017 at 02:27 GMT


In Android Studio on Ubuntu localhost needs to be changed to 10.0.2.2 in order for storybook to work, the emulator doesn't recognize localhost

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by linonetwo
Friday Jan 06, 2017 at 07:11 GMT


Nowadays I just read different config files when running by different npm script....

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by gourav-singhal
Thursday Mar 09, 2017 at 13:02 GMT


Hi

I am getting this same error I tried the solution as suggested by @linonetwo but still no success. Can anybody help ?

@shilman
Copy link
Member Author

shilman commented Apr 15, 2017

Comment by tutaslabs
Sunday Mar 12, 2017 at 04:55 GMT


adb reverse tcp:7007 tcp:7007

@ndelangen
Copy link
Member

@mnmtanish Do you think there's something we still need to do here?

@ndelangen
Copy link
Member

I'm pretty sure this is a duplicate: #846

Please re-open if it isn't 👍

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