3

I hate to ask a question this open-ended, but I'm asking after 4 straight days of trial, error and pure desperation.

My question is:

Are there any un-obvious "gotchas" for bundling a React Native app for TestFlight? Because my app crashes on launch, but only in TestFlight. The crash reports only show RCTFatal (screenshot below).

My RN (0.54) build includes CodePush for my JS bundle, I use a Release scheme / Production certificate scheme when archiving follow all of the directions from CodePush/React Native. The app works, but not when packaged. Any idea, or best guesses what could be the case?

Update:

It's throwing an error when I run my Release Scheme on simulator:

Update (2): The conversation has been moved to chat: https://chat.stackoverflow.com/rooms/170610/discussion-on-question-by-user1791914-react-native-app-crashes-immediately-on-io

Update (3): This issue is still relevant, but I've opened up a separate question as debugging as revealed more info: React Native bundle error for Release, Babel not working?

React Native / Babel isn't compiling spread operators correctly, so this is a config issue that needs sorted.

Unhandled JS Exception: Unexpected token '...'.

Is this a Babel spread operator error?

enter image description here

user1791914
  • 616
  • 9
  • 23

1 Answers1

2

So this turned out to be a syntax/js issue after all and had nothing to do with my build. I had an instance with

{...props.children} which should have been {props.children}

in one of my jsx files. This was causing really inconsistent results with the app crashing in some cases and not in others. It also led me on a wile goose chase trying to reconfigure babel and my release build as the Debug build was handling the error silently.

user1791914
  • 616
  • 9
  • 23
  • 1
    please, how did you arrive at the error? i am having the same issue and dont know how to trace it. thanks in advance – CanCoder Oct 15 '18 at 11:04
  • 1
    @leeCoder tracing was really hard for me. I don't know if there was an easy way to do it, but I set up a test-app.js file, set the app to run from there and imported one file at a time until I could pin-point which file(s) were causing problems. I'm not saying this is the best way, but it helped. – user1791914 Oct 15 '18 at 16:59