This produces the following error when the app opens:
ReactNative: ReactInstanceManager.createReactContext()
ReactNative: Initializing React Xplat Bridge.
ReactNative: Initializing React Xplat Bridge before initializeBridge
ReactNative: Initializing React Xplat Bridge after initializeBridge
ReactNative: CatalystInstanceImpl.runJSBundle()
ReactNative: ReactInstanceManager.setupReactContext()
ReactNative: CatalystInstanceImpl.initialize()
E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.kinvent.kforce, PID: 25576
com.facebook.react.common.JavascriptException: ReferenceError: Can't find variable: error, stack:
<unknown>@25:117
v@2:1474
<unknown>@19:205
v@2:1474
<unknown>@14:167
v@2:1474
<unknown>@13:253
v@2:1474
<unknown>@12:145
v@2:1474
<unknown>@8:126
v@2:1474
<unknown>@6:44
v@2:1474
d@2:876
global code@3143:4
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:71)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
at android.os.Looper.loop(Looper.java:224)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
at java.lang.Thread.run(Thread.java:919)
and then the app crashes immediately.
This is not happening on development build if i add the same transform plugin in development mode.
Also, this is not happening when i add { exclude: ["error", "warn"] } options to the transform plugin
Describe the bug
Using
transform-remove-console
triggersReactNativeJS: ReferenceError: Can't find variable: error
only on production buildTo Reproduce My babel.config.js file:
Actual Output
This produces the following error when the app opens:
and then the app crashes immediately.
This is not happening on development build if i add the same transform plugin in development mode. Also, this is not happening when i add
{ exclude: ["error", "warn"] }
options to the transform pluginMy package.json file: