This post (ECONNRESET every 2 to 10 minutes) was recently locked due to inactivity, but I wanted to bump it up because I’m seeing this error, as well, at about the same frequency. I’ll run expo start, send the app to my simulator or device, and inevitably, within a few minutes, I’ll get this error and have to stop and restart Expo. It’s happened on several different apps, SDK 31 and 32, and a reboot of my Mac does not cure the issue.
The only caveat I’ll add is that sometimes I go without this error happening for a few days before it flares up again. Not entirely sure, but I think when it’s not happening, it has generally started up when I stop just developing on my main project and switch over temporarily to something else (e.g., a burner project to demo an issue or something) and then switch back.
I thought I saw somewhere on Google that this is a pretty generic Node error and may have something to do with some other app trying to use the 1900x ports that Expo uses. I have no idea what would be using that on my system besides Expo, however.
Any ideas on how to troubleshoot this? Thank you!
Oh, and the original post:
Me and my colleague (we are not on the same network) have the same issues since today. Every 2 to 10 minutes, we have this error
[12:30:57] throw er; // Unhandled 'error' event
[12:30:57] Error: read ECONNRESET
[12:30:57] at TCP.onStreamRead (internal/stream_base_commons.js:162:27)
[12:30:57] Emitted 'error' event at:
[12:30:57] at emitErrorNT (internal/streams/destroy.js:82:8)
[12:30:57] at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
[12:30:57] at processTicksAndRejections (internal/process/next_tick.js:76:17)
We have this error while doing nothing, it just happens randomly. I have developped with expo the last 5 months and already encounter this error but maybe twice a day. I typed Ctrl+C and expo start again. But now, it happens too often and it is a real problem.
Can you tell me if this problems comes from our config or from Expo itself ?
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:162:27)
Emitted ‘error’ event at:
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
Currently using latest SDK 32, latest expo-cli aswell as latest mobile expo app.
Sometimes the error happens only a couple of times, but now it’s happening all the time. Unusable at this point. Will try rolling back to earlier version and see how I get on.
It stopped for about a day and then started again. I noticed it started up shortly after connecting an iPhone simulator and an Android device, and turning on the debugger on the simulator.
When it does start happening again, I notice that I get multiple (2-3) “Finished building” lines in the terminal when refreshing a single device, even when I close out Expo on the Android phone. The simulator will often fail to reload the app after the first refresh (I’ll get one of those “Packager not ready” or hex code redboxes). Often there’s a lot of these really short timed ones, too (like the “2 ms”):
Then failed with a redbox, then refreshed again:
Seems like once this happens, I often get stuck in states where the Expo app is unusable (just a blank white screen), and I need to swipe the app closed, or sometimes it’s just easier to reboot the sim, as the Expo app sometimes doesn’t reload when I go back into it again.
UPDATE: One more observation. Obviously, once this error occurs, I have to CTRL + C to close the expo-cli so I can restart it. Quite often, after forcing expo closed like this, “Exponent” will remain in my Activity Monitor, and start pegging my processor.
The more I play with it, this does seem highly-correlated with connecting an iPhone simulator and then connecting an Android device. After the error happens, if I then kill expo CLI, and completely kill anything Expo-related on the Android device, and then restart Expo and run it on the simulator, it seems to work OK. (until I connect the Android phone again…)
I’d the same error building for android with expo.
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
Simulating I got other error, looks like expo-permissions and react-native-webview got greater versions than expo expected.
So I reinstalled these packages:
expo install expo-permissions
expo install react-native-webview
And it looks it worked for me!