SDK version: 45.0.4 (but also SDK 44)
When I upgraded an existing app to SDK 44/45, I noticed this persisting bug after running my app on iOS (both simulator and device). To double check, I’ve created a new Expo app just now (SDK 45.0.4), and this completely clean app runs into the same code (also tried different iOS versions/devices).
I’ve tried all solutions suggested here and at other forums (including removing node_modules, installing react-native-screens to the dependencies, etc), but nothing seems to work.
Wondering if anyone else experiences the same issue and found a solution.
Error: Requiring unknown module "undefined". If you are sure the module exists, try restarting Metro. You may also want to run yarnornpm install. at node_modules/react-native/Libraries/Core/ExceptionsManager.js:95:4 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:141:19 in handleException at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError at node_modules/metro-runtime/src/polyfills/require.js:203:6 in guardedLoadModule at node_modules/expo/build/launch/RecoveryProps.js:4:42 in attachRecoveredProps at node_modules/expo/build/launch/withExpoRoot.js:17:30 in ExpoRoot at node_modules/react-native/Libraries/ReactNative/renderApplication.js:76:4 in renderApplication at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:119:25 in runnables.appKey.run at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:213:4 in runApplication
If I init a new app, run expo start, press i to open the app in Expo Go in the Simulator everything works as expected except for one weird error which doesn’t seem to affect anything:
› Opening on iOS...
› Opening exp://192.168.1.123:19000 on iPhone 13
› Press ? │ show all commands
Error: ENOENT: no such file or directory, scandir '/private/tmp/blah/assets/icons'
iOS Bundling complete 10445ms
iOS Running app on iPhone 13
I can’t see where that ENOENT error is coming from. I can’t find anything referencing that path. But the app opens in Expo Go with the “Open up App.tsx to start working on your app!” message.
Wasn’t clear before about the exact steps (specifically building), but this is exactly what I do:
I just did it again with the same result (and indeed with the blank/typescript template). The “@expo/metro-config” package wasn’t added; must have been something I did myself previously. But I still see the same error.
Unfortunately, it didn’t help. Also updated XCode, didn’t work.
At this point, I really wonder what is going wrong here - or what I could do/reset to prevent it from happening. Is there some way to see which module is being loaded (or which line of code is responsible for loading the ‘undefined’ module?
tried that out, can’t reproduce it on my machine. this seems like there must be some global node issue on your machine. can you try uninstalling node entirely, reinstalling, and running the project again?
Tried clearing the caches, but didn’t work. Then I deleted all modules, and performed clean install with npm - I know, should’ve tried this much sooner. Everything is working now and the bug is not showing up. I think it’s safe to say that the problem is caused by Yarn, even after clearing its caches.
I have encountered weird errors before when expo-cli was installed globally using yarn which were fixed when installing it with npm instead.
I’ve also recently seen someone on the forums who was having weird issues when he installed his dependencies with npm which were fixed by switching to yarn.
I use npm to install things like expo-cli and eas-cli globally. I use yarn to manage the dependencies in my apps.
EDIT: Oh, I have also run into a weird issue with yarn running out of memory when trying to upgrade an app to Expo SDK 45 from 44. This was “fixed” by removing yarn.lock and re-running yarn before trying the upgrade again.