简体   繁体   中英

React Native Expo Timout Error

I'm currently trying to learn react native. I created a project using create-react-native-app. After the project is created, I started npm start on the folder which shows the QR code. I've installed the expo app on my android phone and scanned the code but I'm getting a Uncaught Error: Timed out, no manifest in cache on my expo app and there is no stack trace given.

I've made it work a while ago but somehow its currently not working.

Im using windows 10. npm 5.6 yarn 1.5.1

What I've done to fix it using Ubuntu was (I created my app using create-react-native-app):

  1. open terminal
  2. execute ifconfig
  3. find network interface (wlp4s0, in my case)
  4. execute export REACT_NATIVE_PACKAGER_HOSTNAME="IP_FOUND_BEFORE"
  5. yarn start
  6. SUCCESS! Finished building JavaScript bundle in 10069ms

Expo only supports the most recent 6 versions, this is because we have to have all the native code for each version on the client and that gets big fast 🙃💣. As of writing this v26 is almost out, that version of the expo client will not support v19 projects. Please make sure that your app is up-to-date by going to the app.json (or exp.json depending on how old your project is 😅) and checking the version number.

Outside of that, I would also recommend you start your project by calling exp start in the root folder of your project 💙

The problem that causes this is having multiple network connections. In my case, I have a virtual network connection which is used by the packager instead of the wifi connection. So basically what's happening is that my phone and my computer uses different connections. I've found a solution here: https://github.com/react-community/create-react-native-app/issues/598

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM