Expo DevTools shows An Unexpected Error Occured

Viewed 1565

So, before anyone asks for the minimal code, I haven't wrote one yet. It's the default template. I just set up the environment and made a new project and ran npm start to test it out. However, DevTools opens up in my browser at localhost:19002 but with this error: "An Unexpected Error has occured." It's a completely black screen with only this error text. However, I can still scan the QR code using my iPhone. There are no error logs in the terminal except: npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. but I doubt they are linked. Are they though?

2 Answers

Found the solution! Apparently expo-cli v5.4.10 has some issues with the web interface. Rolled back to 5.4.9 and DevTools work again now. This is the rollback command npm i -g expo-cli@5.4.9

Expo has been intending on removing the web interface for a while now (in v6.0.0), as shown in this article: https://blog.expo.dev/sunsetting-the-web-ui-for-expo-cli-ab12936d2206. Instead, you will have to use the command line to test your app. I personally don't see how it is easier, but it is not a bug, the expo team have intentionally deprecated the web interface.

I suggest that you try to learn the command line interface, because as soon as you need to update expo cli, then you will have no choice.

Related