Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unhandled JS Exception: t is not a function. (In 't(c)', 't' is false)" on Production bundle #26489

Closed
DanielDanaee opened this issue Sep 18, 2019 · 8 comments
Labels
Bug Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@DanielDanaee
Copy link

DanielDanaee commented Sep 18, 2019

React Native version: 0.58.3

When building the release bundle, on both platforms, the app crashes on launch or gets stuck on the black screen on iOS.

But on the Dev Mode everything runs smoothly.

Log:

2019-09-18 14:43:52.964246+0200 APP_NAME[18561:1491677]  - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2019-09-18 14:43:53.052680+0200 APP_NAME[18561:1491677] 5.17.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50600000 started
2019-09-18 14:43:53.055493+0200 APP_NAME[18561:1491677] 5.17.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2019-09-18 14:43:53.060321+0200 APP_NAME[18561:1491697] 5.17.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2019-09-18 14:43:53.118524+0200 APP_NAME[18561:1491639] [MediaRemote] [AVOutputContext] WARNING: AVF context unavailable for +[MRAVOutputContext sharedAudioPresentationContext]_block_invoke
2019-09-18 14:43:53.118777+0200 APP_NAME[18561:1491639] [MediaRemote] [AVOutputContext] WARNING: AVF context unavailable for SYSTEM
2019-09-18 14:43:53.133669+0200 APP_NAME[18561:1491639] NfcManager created
2019-09-18 14:43:53.255271+0200 APP_NAME[18561:1491678] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fb876600d20] get output frames failed, state 8196
2019-09-18 14:43:53.256357+0200 APP_NAME[18561:1491678] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fb876600d20] get output frames failed, state 8196
2019-09-18 14:43:53.256949+0200 APP_NAME[18561:1491678] TIC Read Status [1:0x0]: 1:57
2019-09-18 14:43:53.257744+0200 APP_NAME[18561:1491678] TIC Read Status [1:0x0]: 1:57
2019-09-18 14:43:53.270 [error][tid:com.facebook.react.JavaScript] t is not a function. (In 't(c)', 't' is false)
2019-09-18 14:43:53.271102+0200 APP_NAME[18561:1491706] t is not a function. (In 't(c)', 't' is false)
2019-09-18 14:43:53.273 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: t is not a function. (In 't(c)', 't' is false)
2019-09-18 14:43:53.272959+0200 APP_NAME[18561:1491679] Unhandled JS Exception: t is not a function. (In 't(c)', 't' is false)
2019-09-18 14:43:53.273 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
2019-09-18 14:43:53.273202+0200 APP_NAME[18561:1491706] Module AppRegistry is not a registered callable module (calling runApplication)
2019-09-18 14:43:53.285672+0200 APP_NAME[18561:1491679] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: t is not a function. (In 't(c)', 't' is false)', reason: 'Unhandled JS Exception: t is not a function. (In 't(c)', 't' is false), stack:

I think it has something to do with the __DEV__ constant, as im using it through out the code to decided between environments and all

@react-native-bot react-native-bot added the Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. label Sep 18, 2019
@bartolkaruza
Copy link

@DanielDanaee thank you for reporting! You could try running a debug build and in the start of index.js setting DEV to false; that way you have a debug build but it is running your release code without obfuscation/minification which should give you a more useful stack trace.

I'm closing this issue here because we're using this issue tracker to find bugs in React Native and I'm fairly confident that your issue describes a bug in your app. Feel free to add more comments here and I'll try to think with you on the problem.

@DanielDanaee
Copy link
Author

DanielDanaee commented Sep 18, 2019

@bartolkaruza Thank you very much for your feedback and help.

I was able to set the DEV to false and run the app as debug and came this error:

Simulator Screen Shot - iPhone Xʀ - 2019-09-18 at 16 35 15

This is my babel config that i have set after that but the error still persists:

module.export = {
  env: {
    production: {
      plugins: ["transform-remove-console"]
    },
    development: {
      plugins: [
        [
          "react-transform",
          {
            transforms: [
              {
                transform: "react-transform-hmr",
                imports: ["react-native"],
                locals: ["module"]
              }
            ]
          }
        ]
      ]
    }
  },
  presets: ["module:metro-react-native-babel-preset"]
};

@DanielDanaee
Copy link
Author

Any updates on this?

@DanielDanaee
Copy link
Author

So i figured out that was with redux and there a null value in the applyMiddleware function

https://github.com/LogRocket/redux-logger#log-only-in-development

@bartolkaruza
Copy link

Great! I'm happy you were able to resolve this yourself.

@Natkarock
Copy link

@bartolkaruza Thank you very much for your feedback and help.

I was able to set the DEV to false and run the app as debug and came this error:

Simulator Screen Shot - iPhone Xʀ - 2019-09-18 at 16 35 15

This is my babel config that i have set after that but the error still persists:

module.export = {
  env: {
    production: {
      plugins: ["transform-remove-console"]
    },
    development: {
      plugins: [
        [
          "react-transform",
          {
            transforms: [
              {
                transform: "react-transform-hmr",
                imports: ["react-native"],
                locals: ["module"]
              }
            ]
          }
        ]
      ]
    }
  },
  presets: ["module:metro-react-native-babel-preset"]
};

Hello! Please give me a code, where you set DEV to false. I can't find it in index.js

@dowmeister
Copy link

So i figured out that was with redux and there a null value in the applyMiddleware function

https://github.com/LogRocket/redux-logger#log-only-in-development

you saved my day!

@juanjsebgarcia
Copy link

juanjsebgarcia commented Feb 6, 2020

In my case I was trying to await AsyncStorage.getItem(undefined); when not in __DEV__ (A silly mistake from some weeks ago). 🤦🏻‍♂️

I was able to troubleshoot by building a development build onto an Android device. Then disabling DEV mode in the shake menu.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 3, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests

6 participants