Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

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

Closed
linonetwo opened this issue Dec 17, 2016 · 9 comments

Comments

@linonetwo
Copy link

linonetwo commented Dec 17, 2016

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.

@linonetwo
Copy link
Author

Ok, seems using:

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

can do this.

@linonetwo
Copy link
Author

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

@linonetwo
Copy link
Author

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.

@linonetwo linonetwo reopened this Dec 17, 2016
@thani-sh thani-sh self-assigned this Dec 19, 2016
@thani-sh
Copy link
Contributor

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.

@DandroidDeveloper
Copy link

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

@linonetwo
Copy link
Author

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

@gourav-singhal
Copy link

Hi

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

@tutaslabs
Copy link

adb reverse tcp:7007 tcp:7007

@ndelangen
Copy link
Contributor

Please open an issue over at the new repo if you're still experiencing this issue, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants