expo: Expo CLI crashes when internet is unavailable or Expo servers are down

Summary

I love Expo, thank you so much for all the hard work you put into making this tool so powerful and easy to use.

One issue does seem to continually get in the way—I often find that my dev server will crash unexpectedly because Expo’s servers are unavailable. I was also surprised to find that the CLI doesn’t work without internet (without an extra flag). E.g. just now, in the middle of a development session:

/Users/sam/Developer/my-sound-stories/node_modules/metro-hermes-compiler/src/emhermesc.js:77
          throw ex;
          ^

RuntimeError: abort(CommandError: Unexpected response when updating the development session on Expo servers: Service Unavailable.). Build with -s ASSERTIONS=1 for more info.
    at process.abort (/Users/sam/Developer/my-sound-stories/node_modules/metro-hermes-compiler/src/emhermesc.js:402:15)
    at process.emit (node:events:538:35)
    at emit (node:internal/process/promises:140:20)
    at processPromiseRejections (node:internal/process/promises:274:27)
    at processTicksAndRejections (node:internal/process/task_queues:97:32)

After some digging, I’m still not sure why the CLI needs to contact the internet at all—there is no apparent value to me as a user? This makes it extremely frustrating when this useless functionality often gets in the way.

I don’t think there’s anything wrong with functionality that has platform value, but it would be great if it was made clear why this was happening, and more importantly if this functionality fails it should fail silently, particularly as you’re very unlikely to be able to provide the uptime on your servers needed not to interrupt the dev experience (the expo server produced Service Unavailable as above, even though the Status site shows all green)

Environment

expo-env-info 1.0.3 environment info: System: OS: macOS 12.3 Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.2 - ~/.asdf/installs/nodejs/16.14.2/bin/node Yarn: 1.22.18 - ~/.asdf/installs/nodejs/16.14.2/.npm/bin/yarn npm: 8.5.0 - ~/.asdf/plugins/nodejs/shims/npm Managers: CocoaPods: 1.11.3 - /Users/sam/.asdf/shims/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 30, 32 Build Tools: 29.0.2, 32.0.0, 32.1.0, 33.0.0 System Images: android-32 | Google APIs ARM 64 v8a, android-Tiramisu | Google Play ARM 64 v8a IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.4/13F17a - /usr/bin/xcodebuild npmPackages: expo: ^45.0.0-beta.9 => 45.0.0-beta.9 react: 17.0.2 => 17.0.2 react-dom: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-native-web: 0.17.7 => 0.17.7 npmGlobalPackages: eas-cli: 0.52.0 expo-cli: 5.4.7 Expo Workflow: managed

Please specify your device/emulator/simulator platform, model and version

iOS 15.5 on iPhone 13 simulator

Error output

/Users/sam/Developer/my-sound-stories/node_modules/metro-hermes-compiler/src/emhermesc.js:77
          throw ex;
          ^

RuntimeError: abort(CommandError: Unexpected response when updating the development session on Expo servers: Service Unavailable.). Build with -s ASSERTIONS=1 for more info.
    at process.abort (/Users/sam/Developer/my-sound-stories/node_modules/metro-hermes-compiler/src/emhermesc.js:402:15)
    at process.emit (node:events:538:35)
    at emit (node:internal/process/promises:140:20)
    at processPromiseRejections (node:internal/process/promises:274:27)
    at processTicksAndRejections (node:internal/process/task_queues:97:32)

Reproducible demo or steps to reproduce from a blank project

Run the code without internet, or just wait and Expo servers will eventually be unreachable for some reason.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 8
  • Comments: 21 (4 by maintainers)

Most upvoted comments

@duggster - try npx expo start --offline to work around that error

Fixed after upgrade to expo 46.0.16

what is this error Unable to reach Expo servers. Falling back to using the cached dependency map (bundledNativeModules.json) from the package “expo” installed in your project. CommandError: Unexpected response when fetching version info from Expo servers: Service Unavailable.

The same here. However, my error is slightly different.

/Users/x/node_modules/metro-hermes-compiler/src/emhermesc.js:404
      throw e;
      ^

RuntimeError: abort(FetchError: request to https://api.expo.dev/v2/development-sessions/notify-alive failed, reason: connect ETIMEDOUT 104.18.7.41:443). Build with -s ASSERTIONS=1 for more info.
    at process.abort (/Users/x/node_modules/metro-hermes-compiler/src/emhermesc.js:402:15)
    at process.emit (node:events:539:35)
    at emit (node:internal/process/promises:140:20)
    at processPromiseRejections (node:internal/process/promises:274:27)
    at processTicksAndRejections (node:internal/process/task_queues:97:32)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
ERROR: command finished with error: command (apps/app) yarn run dev exited (1)
command (apps/app) yarn run dev exited (1)
Environment info
expo-env-info 1.0.5 environment info:
  System:
    OS: macOS 12.5.1
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8309675
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  npmGlobalPackages:
    eas-cli: 2.1.0
    expo-cli: 6.0.5
  Expo Workflow: managed
`package.json`
{
  "name": "app",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "clean": "rm -rf node_modules/",
    "dev": "yarn start"
  },
  "dependencies": {
    "@gorhom/bottom-sheet": "^4.4.3",
    "@react-navigation/bottom-tabs": "^6.3.2",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/native-stack": "^6.7.0",
    "expo": "~46.0.2",
    "expo-app-loading": "~2.1.0",
    "expo-font": "~10.2.0",
    "expo-haptics": "~11.3.0",
    "expo-image-picker": "~13.3.1",
    "expo-linear-gradient": "~11.4.0",
    "expo-splash-screen": "~0.16.1",
    "expo-status-bar": "~1.4.0",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "0.69.4",
    "react-native-auth0": "^2.13.3",
    "react-native-confirmation-code-field": "^7.3.0",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-reanimated": "~2.9.1",
    "react-native-safe-area-context": "^4.3.1",
    "react-native-screens": "^3.15.0",
    "react-native-svg": "12.3.0",
    "react-native-web": "~0.18.7",
    "zustand": "^4.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.18.6",
    "@types/react": "~18.0.0",
    "@types/react-native": "~0.69.1",
    "@types/react-native-auth0": "^2.13.1",
    "typescript": "^4.6.3"
  },
  "private": true
}

Same issue here, has gotten really bad in the past couple of days. My server crashes all the time and hot reload is painfully slow.