react-native: Bundlejs error on release build
- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Note: I’ve gone through other issues but it doesn’t seem like they are getting the same error.
Environment
Environment: OS: macOS High Sierra 10.13.4 Node: 9.11.1 Yarn: Not Found npm: 5.6.0 Watchman: 4.9.1 Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found
- Also using Xcode 9.4
Packages: (wanted => installed) react: ^16.3.1 => 16.3.1 react-native: ^0.55.4 => 0.55.4
Description
For some reason I am getting the following error when building a release version of my application via react-native.
*** Terminating app due to uncaught exception ‘RCTFatalException: Unhandled JS Exception: t.typeof is not a function. (In ‘t.typeof(“function”==typeof Symbol?Symbol.iterator:“@@iterator”)’, ‘t.typeof’ is undefined) (/Users/…/THEAPP.app/main.jsbundle:11)’, reason: 'Unhandled JS Exception: t.typeof is not a function. (In ‘t.typeof("function…’
I have tried the following:
- Making bundle by editing the Scheme to be a Release bundle
- Export a bundle myself by using the following:
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
I get the same error for both of these. And of course, this is after I change my AppDelegate.m to the following:
//jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 24 (9 by maintainers)
Hi there @bgold0 @vovkasm @codejamninja @ronal2do , I had the same pb and I fix it by replacing the content of my
.babelrc
file.Before (with the bug from babelHelpers) :
After (🎉) :
@padupuy You made my day, bro. I tried hundred configs without success and just remove presets env made my project working perfectly again. It like a dream. :lol:.
@Winglonelion yup
I solved this issue by completely restarting my application from scratch using:
react-native init PROJECTNAME
Then installing all my dependencies one-by-one.
Thank you so much @vovkasm for taking the time to help.