Search code examples
react-nativeexporuntime-errorexpo-go

Run reactnative(Expo) project in chromebook / virtual linux machine


I am currently using chrome os flex as my enviroment setup in chromeosflex i installed everything related to expo project when i run any expo project it runs fine but can't open in my phone(expo go app) when i try to run project on my phone i getting error like thisthis error


Solution

  • the default Connection option: LAN, doesn't work for chromeOS ... To know the source of the problem .. you can read this article

    you should change the default CONNECTION option to either:

    1. Tunnel

    Using the "Tunnel" connection type will make app reloads considerably slower than on "LAN" or "Local", so it's best to avoid tunnel when possible.

    1. Local if you have your device connected via a USB cable (don't forget to enable the USB debugging for your phone)

    if you are using expo sdk-45 or under: you can accomplish the above from the Web UI for Expo CLI, from the left panel change the CONNECTION option

    for sdk-46 or above: since the Web UI for Expo CLI is not available any more read more .. you can accomplish the above by the running npm run start:tunnel or npm run start:local after you have added the following scripts to your package.json

    "scripts": {
      ...
      ......
      "start:tunnel": "expo start --tunnel",
      "start:local": "expo start --localhost",
      ..... 
      ...
     },