remote-redux-devtools icon indicating copy to clipboard operation
remote-redux-devtools copied to clipboard

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

Open donpinkus opened this issue 5 years ago • 14 comments

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 avatar Jan 23 '19 01:01 donpinkus

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

rgomezp avatar Aug 16 '19 07:08 rgomezp

I have the same problem!

georgeMorales avatar Aug 16 '19 20:08 georgeMorales

Has anyone solved this problem?

mktsofteasy avatar Aug 19 '19 13:08 mktsofteasy

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

rgomezp avatar Aug 27 '19 04:08 rgomezp

same issue

ghasemikasra39 avatar Sep 04 '19 12:09 ghasemikasra39

I also have the same issue.

henriqueshishido avatar Sep 05 '19 19:09 henriqueshishido

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 😅

gguidotti avatar Sep 13 '19 10:09 gguidotti

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.

rickshido avatar Sep 13 '19 15:09 rickshido

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 :+1: It's working. You're amazing man.

ghasemikasra39 avatar Sep 14 '19 05:09 ghasemikasra39

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

rgomezp avatar Sep 16 '19 18:09 rgomezp

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.

rickshido avatar Sep 16 '19 18:09 rickshido

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" ?

ardyfeb avatar Jan 20 '20 16:01 ardyfeb

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.

Mazvangui avatar Nov 01 '20 18:11 Mazvangui

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

Rawan-Eltobgy avatar Nov 22 '20 11:11 Rawan-Eltobgy