Uncaught Error: Application main has not been registered

Hi,

I am having trouble with building my App. Running it via Expo in the simulators (iOS and Android) works fine, but after building it it triggers a blue screen with the Error mentioned in the title.

Further investigation leads to discovering one more error:

Unfortunately I have no clue how to trace that error back and how or why this is happening.

I am not running any other packager at the same time and I did not modify the original entry point (it is still App.js)

Also I was not able to provoke the error with exp start --no-dev --minify, it continues to run as expected in Expo.

I would really appreciate if someone could help me or had suggestions for me to try out, because I am at the end of my wits after 6 hours of trying to fix this :confused:

Infos on my config:
sdkVersion: 25.0.0

EDIT:

exp --version
50.0.1

EDIT 2:
After deleting node_modules and clearing the packager cache (like described here: https://forums.expo.dev/t/how-to-clear-the-react-native-packager/1352), I can reproduce the error (o is not a function) while simulating with --no-dev --minify

Running in Expo App with --dev --no-minify is working again. So the error seems to happen in some optimization step.

Trying exp --no-dev --no-minify next… stay tuned

EDIT 3:

Alright folks, I finally got an error to work with, which led me to https://github.com/infinitered/reactotron/issues/483, I had Reactotron configured conditionally when in dev mode, which was of course not initialized when in prod mode which led enhanceReducers to fail because the Reactotron middleware was not defined.

This seems to have been the issue, building right now and hoping that I am good to go again.

What I learned from this: Be more careful with your if(__DEV__) usage, keep cool and always exhaust your own possible points of failure before starting to look for errors in your toolchain.

Most helpful command: exp r --no-dev --no-minify

I wished that this process would have been more straightforward though, had I known the --no-dev --no-minify option from the start, I had found the error in 10 minutes instead of a whole day.

All in all, thanks to the Expo team for this great piece of software, I really love working with Expo and it never let me down so far.

EDIT 4:

I can confirm that this was really the issue, yay for me I guess.

What is left however: Why is such an error not happening / encountered sooner (i.e. in the bundling and preparation step locally or then on the servers)? That might be worth investigating.

1 Like

@elprincipe Glad you got it resolved. Nothing more frustrating than trying to fix an error for hours on end to no prevail. Thanks for updating with the solution though!

Cheers,

Adam

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