Standalone build issue with v30


#1

Hi all, I’m having an issue with building standalone apps at the moment. I’m getting the dreaded Module AppRegistry is not a registered callable module message at startup of the app, after seeing the splash screen, with the underlying error message on both Android and iOS being undefined is not an object (evaluation 'u.default.get'). Not exactly a helpful message, and I can’t figure out how to take a look at the underlying minified bundle that’s causing issues. Does anyone have any idea how I can better figure out what’s causing this issue? We last built standalone apps on Expo 27, but now even that doesn’t work on either iOS or Android.


#2

Hey @josh-es,

Running expo start --no-dev --minify will replicate the environment that a Standalone build runs. Doing that may provide some more information. Also checking device logs via adb or Xcode may provide additional information.

Cheers,

Adam


#3

Hey @adamjnav,

Thanks for your response! The complete device logs (obtained via idevicesyslog) are below for info, but they don’t give that much detail:

Oct  2 15:13:44 iPhone ExpoKitApp[4498] <Error>: undefined is not an object (evaluating 'u.default.get')
Oct  2 15:13:44 iPhone ExpoKitApp[4498] <Error>: Unhandled JS Exception: undefined is not an object (evaluating 'u.default.get')
Oct  2 15:13:44 iPhone ExpoKitApp[4498] <Error>: Module AppRegistry is not a registered callable module (calling runApplication)
Oct  2 15:13:44 iPhone ExpoKitApp[4498] <Error>: Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

The behaviour of expo start --no-dev --minify is that the downloading JavaScript bundle phase gets stuck at 99.93% on the first run, then loses connection to the development server, showing a red error screen. Then, a white error screen shows up, again saying Could not connect to development server and saying There was a problem running "app name". Hitting try again on that screen reloads the bundle, and everything then works perfectly fine. So not much useful info from that.

Best,

Josh


#4

Hi @adamjnav,

I managed to track the problem down in my code, looking at the bundleUrl that is printed out in the manifest when running the app locally using the Expo CLI, you can navigate to that URL and take a look at the bundle as it would appear in production.

This let me trace the problem to a particular part of my code, it appears to be related to import order somehow. In the Expo CLI, an imported component is always defined and that part of the code never causes any issues. In a standalone build, it becomes possible for that component to have not been imported/loaded yet. Is there some kind of difference in the module system in both cases? Perhaps something that’s initialised at startup in the Expo Client, and so is always available when you load an app, but is not always available in a standalone build?

Not sure what the cause of the issue is, but it’s good to get to a solution. Just would like to understand this more to mitigate in the future! :slight_smile:

Best,
Josh


closed #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.