I’m using the latest expo, React Native SDK 36.0.0, and I always get the following message once I connect from my phone back to the PC:
Error: Unable to resolve module
./node_modules\expo\AppEntry
from ``:
I used expo init foo to create the initial app, and have selected various of the options, both ts and js, but have the same issue every time. I tried it with yarn and then uninstalled yarn and tried again, still with the same result.The file pointed to from main in package.js is node_modules/expo/AppEntry.js and it exists. The error message says that none of the list of files are found:
node_modules\expo\AppEntry(.native|.android.expo.ts|.native.expo.ts|.expo.ts|.android.expo.tsx|.native.expo.tsx|.expo.tsx|.android.expo.js|.native.expo.js|.expo.js|.android.expo.jsx|.native.expo.jsx|.expo.jsx|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.wasm|.native.wasm|.wasm)
although .js is in the list (marked in bold).
My expo-cli version is 3.13.1, npm is 6.13.7 and node is 13.9.0.
There are a number of topics similar to this using old SDKs and one that appeared to work referred to using a list of extensions in the packagerOpts object, but that object doesn’t exist and it still fails when I add it. Some older comments claim that it is caused by Metro but I can’t see that, although I don’t know metro.
After almost 3 days of trying all sorts of weird and wonderful workarounds, I’m about to abandon React Native and use Cordova or Ionic instead - not my first choice, but if it doesn’t work for the simple out-of-the-box case, I really don’t have a choice.