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

2 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.

1 Like

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.

1 Like

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.

1 Like

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

Hi any one found solution for this issue? i am using 35.0.0 and after few Minute i am getting this error.41%20PM

I have noticed this too, off and on, and I can’t seem to find a consistent pattern for it other than it seems to happen after I’ve left my Mac on for a few days. Rebooting seems to fix it.

I’m hoping that SDK 36 with React Native 0.61 and Fast Refresh might help with this issue when it is released.

When this happens to me I just press ‘r’ or ‘R’ in the terminal window to restart the packager. Then I either save one of the files or reload or restart the app on the device.

It still there with

Expo CLI 3.21.5 environment info:
    System:
      OS: macOS Mojave 10.14.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.18.1 - /usr/local/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.14.5 - /usr/local/bin/npm
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      expo: ^35.0.1 => 35.0.1
      react: 16.8.3 => 16.8.3
      react-dom: 16.8.3 => 16.8.3
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8
events.js:292
      throw er; // Unhandled ‘error’ event
      ^
Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
Emitted ‘error’ event on Socket instance at:
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: ‘ECONNRESET’,
  code: ‘ECONNRESET’,
  syscall: ‘read’
}

Hi,
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!
Regards
Lluís

expo --version
4.5.2

Here same error, when I try to build my two applications.

expo build:android -t apk

Uploading JavaScript bundles
read ECONNRESET
Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)

1 Like