com.facebook.react.common.JavascriptException TypeError: undefined is not an object (evaluating 'n.replace'), stack

Am currently using expo SDK 42, i have to build my app and distributed it to the stores, however, when i use EAS i get the error below, I have distributed it using expo build and it now works perfect, I have researched on this for two days now and can’t get an reason why this is happening since the APK is working perfect and also the app launches successfully on the expo Go app.

com.facebook.react.common.JavascriptException: TypeError: undefined is not an object (evaluating 'n.replace'), stack:
global code@3188:3
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(
  at java.lang.reflect.Method.invoke (Native Method)
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (
  at (Native Method)
  at android.os.Handler.handleCallback (
  at android.os.Handler.dispatchMessage (
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (
  at android.os.Looper.loop (
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$ (
  at (

Hey @ariahealth, want to clarify something before we dive in here…are you saying a SDK42 binary built via expo build works as expected but one built with EAS does not? (Just want to make sure both are on the same SDK versions)

Yes, am using SDK 42, expo build works and i have even deployed on production, but the EAS build is completed but when I open the app i find the above error and the app crashes, I can’t seem to find why this is hapenning

Both builds are completed but the EAS build crashes

This could be because you’re relying on some native code that’s included by default when you use Expo Go (or expo build), but you have not included it in your list of dependencies in package.json.

What dependencies do you have in package.json?

Also, what errors do you get in the adb logcat output when the app crashes?

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