How do I troubleshoot production builds?

Please provide the following:

  1. SDK Version: 42 and 43
  2. Platforms(Android/iOS/web/all): iOS (maybe others too)
  3. This is a normal build. Not bare metal.

I’ve been build an app for several months and everything was going fine. Suddenly, I published a new version of my app that crashed immediately after launch. I tore it down all the way to a minimal example here: GitHub - trevorallred/expo-amplify

What’s happening? I’m seeing different behaviors but I think they’re all related.

  • Running inside a native app from the apple app store. The app crashes on launch.
  • Running a published app inside Expo Go, the app keeps downloading updates in a loop - Expo
  • Running a minimal app (see code above from Github) inside Expo Go, the app doesn’t update but it also never gets past the splash page. Updates aren’t turned on.
  • Running from Expo Go with Production Mode on phone or on Simulator, the app loops on updates or doesn’t load depending on whether or not updates are turned on.

I don’t get any sort of logging or hint at what’s wrong. The app just crashes. However, everything works perfectly fine in development mode.

The offending code is aws-amplify. It’s a massive library and includes aws SDK too, which is almost as big. I did see one time that “aws-amplify”: “4.3.4” started including 2 different versions of graphql (14.0 and 14.5), which you’re not supposed to do. Version 4.3.4 was released a few days before my changes and would totally explain the error. However, when I revert to a previous version 4.3.3, 4.3.2 or even 4.2, the problem doesn’t go away. I also updated from Expo 42 to 43 and still no change. I’ve also tried this on 2 different computers, cleared node_modules, and still get the above crashes in production. Again it always works fine in Dev mode.

I’m going to move away from Amplify given its bloated size. The problems all go away what I do that.

But here’s the real question…

How can I troubleshoot crashes that only occur in production? The app launches and then doesn’t. There’s not log stack trace. No warning. Nothing. Even Sentry didn’t pick up the crash.

My concern here is that I replace Amplify and then some other library causes an unknown issue that can’t be debugged. What do I do?

You touched on a major painpoint with the dev-client workflow.

Expo Go and EAS runtimes are different so your project could run fine on one and not compile on the other one.

I wish that’s just theoretical, but that’s what I’m currently facing in my own expo project.

The latest update here is that I discovered that amplify has a way to reference just individual libraries. I switched from the first line to the second line and my error went away…for now.

import { Auth } from "aws-amplify";
import { Auth } from "@aws-amplify/auth";

Of course this doesn’t solve my original question. How do I troubleshoot production builds (like those from EAS) when the production code doesn’t provide any output?

Have you tried running it in Production mode locally? That didn’t help in my case but I wonder if it would help yours.

This was what fixed my issue Eas build only succeeds when "developmentClient" is set to true - #3 by 10000multiplier

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