Expo dies every few minutes with "Error: read ECONNRESET"

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:

arcades2:

Hello,

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] events.js:173
[12:30:57]       throw er; // Unhandled 'error' event
[12:30:57]       ^
[12:30:57]
[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 ?

Thx

3 Likes

Not sure if this fixed it or if I’m just lucky today, but I deleted the .expo folder from my project, restarted expo, and have not had this issue all day.

Must’ve been lucky- it’s happened a lot today, even after deleting the file again. A few times it even happened on the very first build/ download of the bundle after restarting.

Also seeing this all the time now.

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.

I’ve seen it just as frequently on Expo 31 and 32.

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”):

Example

First load:

Finished building JavaScript bundle in 9312ms.
Finished building JavaScript bundle in 5018ms.

Then failed with a redbox, then refreshed again:

Finished building JavaScript bundle in 171ms.
Finished building JavaScript bundle in 2ms.

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…)

1 Like

Having the same issue.

Error: read ECONNRESET

Mine is occurring almost every time I make a change in my editor.

@nfrith are you developing on an Android device/ emulator? Do you see it more often with Chrome debugging on? Feeling like those factors contribute in some way.

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

Hey everyone,

I reopened this (our Forums auto-close topics after a certain period of inactivity), but you should know that there’s currently an open GH issue on this.

any one found solution for this issue?

i got same error, and it really often today.
i upgrade to 34.0 today, is it connected to this error??