I was using the Expo (SDK 52) Android Emulator (JDK 17) to run my application locally and access my localhost and suddenly I started to get this error from ENOENT by not finding a file called "InternalBytecode.js" and now somehow I can't run my emulator.
ERROR:
ERROR Warning: TypeError: Cannot read property 'regular' of undefined
Error: ENOENT: no such file or directory, open 'C:\CeSolutions\iSuite_Pro\InternalBytecode.js'
at Object.readFileSync (node:fs:441:20)
at getCodeFrame (C:\CeSolutions\iSuite_Pro\node_modules\metro\src\Server.js:949:18)
at Server._symbolicate (C:\CeSolutions\iSuite_Pro\node_modules\metro\src\Server.js:1026:22)
at Server._processRequest (C:\CeSolutions\iSuite_Pro\node_modules\metro\src\Server.js:419:7) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\CeSolutions\\iSuite_Pro\\InternalBytecode.js'
EXPO-DOCTOR
✔ Check package.json for common issues
✔ Check Expo config for common issues
✔ Check native tooling versions
✔ Check for common project setup issues
✔ Check dependencies for packages that should not be installed directly
✔ Check npm/ yarn versions
✔ Check for issues with Metro config
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check if the project meets version requirements for submission to app stores
✔ Check Expo config (app.json/ app.config.js) schema
✔ Validate packages against React Native Directory package metadata
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules use compatible support package versions for installed Expo SDK
Didn't find any issues with the project!
I've tried now for two days to find the solution for the Expo SDK 52 but the closest I got was something related to it on github for Expo SDK 47 and even with downgrade I couldn't solve the problem.
Also, the app runs normal with Expo Go App and also prebuilds and builds normally, the problem lies somewhere when the app is being installed in the emulator.
I've also tried the basic things like: "npm i" (again), "npx expo install --fix" and so on, no result.
I'd really appreciate if someone could share the solution.
So, coming back 2 days later to tell that I could solve the problem.
The problem with the InternalBytecode.js file normally lies on some dependency error.
I solve the problem going back into the last commits I've done, till one of them didn't had the problem.
It ends up that the most helpful message had nothing to do with this InternalBytecode.js file, but with the first message I wrote on the question: "ERROR Warning: TypeError: Cannot read property 'regular' of undefined"
As expected, it was a TypeError, where a obj field (fonts) was set to "any" instead of "never".
export const lightTheme: Theme & NavigationTheme = {
dark: false,
colors: {
...
},
fonts: {} as never,
};
So, if you find yourself stuck in the same problem, try to look for the first log and interpret it, it might on the most of the cases be a type problem.