Bugsnag and minified file names

We are trying to integrate our Expo app with Bugsnag (which provides Sentry-like crash/error processing). All seems well except for being to apply source maps properly in order to provide usable stack traces. For whatever reasons Bugsnag requires that the file names associated with minified files have an extensions of ‘.js,’ ‘.bundle’ or ‘.jsbundle’.

For versions of my app built for IOS, all seems fine and I see file names like:

main.jsbundle

or sometimes:

https://RANDOM_DIGITS.cloudfront.net/%40thunkable%2FthunkableCompanion%2F1.0.0%2Fdb7c9f94edab7060d350dfaf09513a38-29.0.0-ios.js

but for Android I see:

/data/user/0/foo.bar/files/29.0.0/cached-bundle-experience-%40foo%2Fbar781564956-29.0.0

which, you can see does not end in a file extension of ‘.js,’ ‘.bundle’ or ‘.jsbundle’.

I don’t really understand what is going on here, but is there anyway that I can cause the minified file to have an appropriate extension?

In case it matters, the project has been ejected to ExpoKit.

Thanks in advance.

-Mark

P.S. I see a mention of a more “normal” bundle URL in the generated AppConstant.java file for our app but for some reason it isn’t getting communicated in the same way as it is for iOS.

Here are the contents of the generated AppConstant.java file, in case that helps. Some of the contents have been lightly obscured with asterisks:

package host.exp.exponent.generated;

import com.facebook.common.internal.DoNotStrip;

import java.util.ArrayList;
import java.util.List;

import host.exp.exponent.BuildConfig;
import host.exp.exponent.Constants;

@DoNotStrip
public class AppConstants {

  public static final String VERSION_NAME = "2.6.2";
  public static String INITIAL_URL = "exp://exp.host/@thunkable/************";
  public static final boolean IS_DETACHED = true;
  public static final String SHELL_APP_SCHEME = "exp***************";
  public static final String RELEASE_CHANNEL = BuildConfig.RELEASE_CHANNEL + '-' + BuildConfig.VERSION_CODE;
  public static boolean SHOW_LOADING_VIEW_IN_SHELL_APP = false;
  public static boolean ARE_REMOTE_UPDATES_ENABLED = true;
  public static final List<Constants.EmbeddedResponse> EMBEDDED_RESPONSES;
  public static boolean FCM_ENABLED = false;

  static {
    List<Constants.EmbeddedResponse> embeddedResponses = new ArrayList<>();

    
        // ADD EMBEDDED RESPONSES HERE
        // START EMBEDDED RESPONSES
        embeddedResponses.add(new Constants.EmbeddedResponse("https://exp.host/@thunkable/************/index.exp", "assets://shell-app-manifest.json", "application/json"));
        embeddedResponses.add(new Constants.EmbeddedResponse("https://***********.cloudfront.net/%40thunkable%2F***************%2F1.0.0%2F*****************-29.0.0-android.js", "assets://shell-app.bundle", "application/javascript"));
        // END EMBEDDED RESPONSES
    EMBEDDED_RESPONSES = embeddedResponses;
  }

  // Called from expoview/Constants
  public static Constants.ExpoViewAppConstants get() {
    Constants.ExpoViewAppConstants constants = new Constants.ExpoViewAppConstants();
    constants.VERSION_NAME = VERSION_NAME;
    constants.INITIAL_URL = INITIAL_URL;
    constants.IS_DETACHED = IS_DETACHED;
    constants.SHELL_APP_SCHEME = SHELL_APP_SCHEME;
    constants.RELEASE_CHANNEL = RELEASE_CHANNEL;
    constants.SHOW_LOADING_VIEW_IN_SHELL_APP = SHOW_LOADING_VIEW_IN_SHELL_APP;
    constants.ARE_REMOTE_UPDATES_ENABLED = ARE_REMOTE_UPDATES_ENABLED;
    constants.EMBEDDED_RESPONSES = EMBEDDED_RESPONSES;
    constants.ANDROID_VERSION_CODE = BuildConfig.VERSION_CODE;
    constants.FCM_ENABLED = FCM_ENABLED;
    return constants;
  }
}

Hi @thunkmark - thanks for bringing this to our attention. We currently do not add an extension to the cached JS bundle files on Android. I’ve added a ticket to track this on GH: https://github.com/expo/expo/issues/2558 but cannot promise that we will get to it on any given timeline.

In the meantime, you can try forking the expo/expo repo and adding this yourself. The relevant code is here: https://github.com/expo/expo/blob/3748c52a84875dee9c5e746ecfe8f2b0b61579b6/android/expoview/src/main/java/host/exp/expoview/Exponent.java#L361

Hope this helps! Sorry we don’t have a better answer for you :disappointed:

Thanks for taking the time, @esamelson and pointing me to the right place in the code.

-Mark

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