2020.09.01_10.59-
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:
Warning
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. 10.0.1.1:8081
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