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

"Socket Hung Up" error with basic setup for web React / Redux #131

Open
donpinkus opened this issue Jan 23, 2019 · 14 comments
Open

"Socket Hung Up" error with basic setup for web React / Redux #131

donpinkus opened this issue Jan 23, 2019 · 14 comments

Comments

@donpinkus
Copy link

I'm using the most basic setup to debug a web-based regular React app.

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'remote-redux-devtools';

const store = createStore(reducer, preloadedState, composeWithDevTools(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

When I open my app, I get this error flooding the console:

connected to remotedev-server

remote-redux-devtools: Socket connection errors are being suppressed. 
This can be disabled by setting suppressConnectErrors to 'false'.

Error {
  code: 1006,
  message: "Socket hung up",
  name: "SocketProtocolError",
  stack: "SocketProtocolError@https://localhost:3000/static/js/bundle.js:119101:28↵_onSCClose@https://localhost:3000/static/js/bundle.js:120445:3…"
}
@donpinkus donpinkus changed the title Socket hung up error with basic setup "Socket Hung Up" error with basic setup Jan 23, 2019
@donpinkus donpinkus changed the title "Socket Hung Up" error with basic setup "Socket Hung Up" error with basic setup for web React Jan 23, 2019
@donpinkus donpinkus changed the title "Socket Hung Up" error with basic setup for web React "Socket Hung Up" error with basic setup for web React / Redux Jan 23, 2019
@rgomezp
Copy link

rgomezp commented Aug 16, 2019

Any update on this? I've tried everything and can't figure this out

@georgeMorales
Copy link

I have the same problem!

@mktsofteasy
Copy link

Has anyone solved this problem?

@rgomezp
Copy link

rgomezp commented Aug 27, 2019

To fix the error, make sure "packagerPort": 19001 is on the same port with "devToolsPort": 19001 on your packager-info.json in .expo folder (expo only)

However, while this fixed the error, the dev tools themselves don't get populated with the state

@ghasemikasra39
Copy link

same issue

@henriqueshishido
Copy link

I also have the same issue.

@gguidotti
Copy link

gguidotti commented Sep 13, 2019

I'm having the same issue with regular React web app. My store is pretty basic at the moment, I'm just using a combindeReducers call with a couple of reducers. Did not setup any middlewares yet so I'm trying to use this extension running the default export from the package itself instead of relying on the { composeWithDevTools }.

EDIT:
I installed the Redux DevTools extension for Chrome and I came here to set everything up, but I just realized that this was not the right place. After switching to the redux-devtools-extension page I followed the instructions and and successfully linked my app with the extension, now everything is fine. My bad 😅

@rickshido
Copy link

rickshido commented Sep 13, 2019

I found a solution for this problem. I will report it as follows:

Step 1 - Verify installed packages:

  • remote-redux-devtools
  • remotedev-server
  • remotedev
  • react-devtools

Step 2 - Verify if the source code file that uses "devTools" contains:
const enhance = composeWithDevTools({
realtime: true,
host: 'localhost',
port: 8000
});

const store = createStore(rootReducer, enhance(applyMiddleware(reduxThunk)));

Step 3 - In Android Emulator settings, verify:

  • DEBUG JS REMOTELY: let it disabled
  • In "DEV SETTINGS" -> "Debug server host & port device": let empty

Step 4 - In the Remote DevTools (Chrome extension):

  • Click in "SETTINGS" button
  • check "use custom (local) server" and fill with the fields --> Hostname: localhost e Port: 8000

Step 5 - In terminal, in the project directory, run:
$ emulator -avd <device_name> //// or start emulator using Android Studio
$ react-native start --reset-cache
$ remotedev --hostname=localhost --port=8000
$ adb reverse tcp:8000 tcp:8000
$ adb reverse tcp:8081 tcp:8081
$ react-native run-android

I hope these steps help you. Any doubts, feel free to contact me.

@ghasemikasra39
Copy link

I found a solution for this problem. I will report it as follows:

Step 1 - Verify installed packages:

  • remote-redux-devtools
  • remotedev-server
  • remotedev
  • react-devtools

Step 2 - Verify if the source code file that uses "devTools" contains:
const enhance = composeWithDevTools({ realtime: true, host: 'localhost', port: 8000 });

const store = createStore(rootReducer, enhance(applyMiddleware(reduxThunk)));

Step 3 - In Android Emulator settings, verify:

  • DEBUG JS REMOTELY: let it disabled
  • In "DEV SETTINGS" -> "Debug server host & port device": let empty

Step 4 - In the Remote DevTools (Chrome extension):

  • Click in "SETTINGS" button
  • check "use custom (local) server" and fill with the fields --> Hostname: localhost e Port: 8000

Step 5 - In terminal, in the project directory, run:
$ emulator -avd <device_name> //// or start emulator using Android Studio
$ react-native start --reset-cache
$ remotedev --hostname=localhost --port=8000
$ adb reverse tcp:8000 tcp:8000
$ adb reverse tcp:8081 tcp:8081
$ react-native run-android

I hope these steps help you. Any doubts, feel free to contact me.

unbelievable 👍 It's working. You're amazing man.

@rgomezp
Copy link

rgomezp commented Sep 16, 2019

@rickshido @ghasemikasra39 ,
Is this different for Expo? Also, what to do if running a real device?

@rickshido
Copy link

Hi @rgomezp
I am not sure if these steps are the same for Expo.
If you are running in a real device, you need change:

const enhance = composeWithDevTools({
realtime: true,
host: '<your_pc_ip_address>',
port: 8000
});
const store = createStore(rootReducer, enhance(applyMiddleware(reduxThunk)));

And, in your Real Device, open the App and go to Dev Settings → Debug server host & port for device. Set your PC_IP_ADDRESS and the port of the (e.g. 10.0.1.1:8000).

I hope it help you.

@ardyfeb
Copy link

ardyfeb commented Jan 20, 2020

Hi @rgomezp
I am not sure if these steps are the same for Expo.
If you are running in a real device, you need change:

const enhance = composeWithDevTools({
realtime: true,
host: '<your_pc_ip_address>',
port: 8000
});
const store = createStore(rootReducer, enhance(applyMiddleware(reduxThunk)));

And, in your Real Device, open the App and go to Dev Settings → Debug server host & port for device. Set your PC_IP_ADDRESS and the port of the (e.g. 10.0.1.1:8000).

I hope it help you.

where i can find "Dev setting -> Debug server host & port" ?

@Mazvangui
Copy link

I found a solution for this problem. I will report it as follows:

Step 1 - Verify installed packages:

  • remote-redux-devtools
  • remotedev-server
  • remotedev
  • react-devtools

Step 2 - Verify if the source code file that uses "devTools" contains:
const enhance = composeWithDevTools({ realtime: true, host: 'localhost', port: 8000 });

const store = createStore(rootReducer, enhance(applyMiddleware(reduxThunk)));

Step 3 - In Android Emulator settings, verify:

  • DEBUG JS REMOTELY: let it disabled
  • In "DEV SETTINGS" -> "Debug server host & port device": let empty

Step 4 - In the Remote DevTools (Chrome extension):

  • Click in "SETTINGS" button
  • check "use custom (local) server" and fill with the fields --> Hostname: localhost e Port: 8000

Step 5 - In terminal, in the project directory, run:
$ emulator -avd <device_name> //// or start emulator using Android Studio
$ react-native start --reset-cache
$ remotedev --hostname=localhost --port=8000
$ adb reverse tcp:8000 tcp:8000
$ adb reverse tcp:8081 tcp:8081
$ react-native run-android

I hope these steps help you. Any doubts, feel free to contact me.

It's working. You're amazing bro @rickshido.

@Rawan-Eltobgy
Copy link

Rawan-Eltobgy commented Nov 22, 2020

Hi @rgomezp
I am not sure if these steps are the same for Expo.
If you are running in a real device, you need change:
const enhance = composeWithDevTools({
realtime: true,
host: '<your_pc_ip_address>',
port: 8000
});
const store = createStore(rootReducer, enhance(applyMiddleware(reduxThunk)));
And, in your Real Device, open the App and go to Dev Settings → Debug server host & port for device. Set your PC_IP_ADDRESS and the port of the (e.g. 10.0.1.1:8000).
I hope it help you.

where i can find "Dev setting -> Debug server host & port" ?

shake your device, you would find a pop-up menu, click settings from it then Debug server host & port

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

No branches or pull requests