Tunnel keeps disconnecting


I started using expo yesterday. Connection is successful when I try Tunnel option. LAN doesn’t work. However, even the Tunnel connection doesn’t last for too long. 1-2 minutes after I connect, I get the message:


Cannot connect to the Metro service.

Try the following to fix the issue…

I first imagined it could be due to my VPN running at the same time, so I disconnected it. Still, connection only lasts shortly.

log from terminal (from where I started the server with npm start):

Cannot connect to the Metro server.

Try the following to fix the issue:
- Ensure that the Metro server is running and available on the same network
- Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices
- If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device
- If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g.

URL: packager.9u-36g.anonymous.rn-starter-app.exp.direct:80

Error: Connection reset
- node_modules/expo/build/environment/muteWarnings.fx.js:18:23 in warn
- node_modules/react-native/Libraries/Utilities/HMRClient.js:262:17 in setHMRUnavailableReason
- node_modules/react-native/Libraries/Utilities/HMRClient.js:190:30 in client.on$argument_1
- node_modules/eventemitter3/index.js:181:39 in emit
- node_modules/metro/src/lib/bundle-modules/WebSocketHMRClient.js:51:16 in _ws.onerror
- node_modules/event-target-shim/dist/event-target-shim.js:818:39 in EventTarget.prototype.dispatchEvent
- node_modules/react-native/Libraries/WebSocket/WebSocket.js:262:10 in _eventEmitter.addListener$argument_1
- node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:190:12 in emit
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:436:47 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:111:26 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:110:17 in __guard$argument_0
* [native code]:null in callFunctionReturnFlushedQueue

In addition, here’s what can be seen from the web server interface (Metro Bundler):

We noticed your tunnel is having issues. This may be due to intermittent problems with our tunnel provider. If you have trouble connecting to your app, try to Restart the project, or switch Host to LAN.

OS: Manjaro Linux, KDE Plasma

Hey @miguelniblock, can you run expo diagnostics and share what it prints out here? Also, did tunnel work properly before or has it always done this?


Thanks for your reply @adamjnav , it did this since the beginning. I only started using it yesterday for the first time.

Expo CLI 3.25.1 environment info:
      OS: Linux 5.7 Manjaro Linux
      Shell: 5.0.18 - /bin/bash
      Node: 12.18.3 - ~/.nodenv/versions/12.18.3/bin/node
      npm: 6.14.6 - ~/.nodenv/versions/12.18.3/bin/npm
      expo: ~36.0.0 => 36.0.2 
      react: ~16.9.0 => 16.9.0 
      react-dom: ~16.9.0 => 16.9.0 
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4 
      react-navigation: ^4.1.0 => 4.4.0 
      expo-cli: 3.25.1

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.