"Source code was not found" when sourcemaps available

I’m seeing this message for events coming from the latest build of our RN Android app:

There was 1 error encountered while processing this event

  • Source code was not found Collapse

Url app:///at index.android.bundle

That file, together with its sourcemap, has been uploaded for that release and distribution, though, so I’m not sure why I’m seeing this “source code was not found” message. What could cause this? We’re using RN Sentry 1.0.0-beta 6, and RN 0.60.4. We also just switched to using react-native-v8 instead of the default RN JS interpreter - could that be related?

Sample bad event: https://sentry.io/organizations/ginger-labs-inc/issues/1230090528/?project=1393587&query=is%3Aunresolved&statsPeriod=14d

You can see that the bundle and sourcemap were uploaded here: https://sentry.io/organizations/ginger-labs-inc/releases/com.gingerlabs.twobird-0.1.4/artifacts/?project=1393587

Something curious to note is that our 0.1.4 release has stack traces that say “app:///at index.android.bundle” while the 0.1.3 release (where we were not uploading sourcemaps or using react-native-v8) has stack traces that say “app:///index.android.bundle”.

Yes, the issue for sure is that the frame location is app:///at index.android.bundle
the at is messing up our matching.

What you can do is changing the RewriteFramesIntegration to fit you needs:

import { RewriteFrames } from "@sentry/integrations";

const rewriteFramesIntegration = new RewriteFrames({
  iteratee: frame => {
    if (frame.filename) {
      frame.filename = frame.filename
        .replace(/^file\:\/\//, "")
        .replace(/^address at /, "")
        .replace(/^.*\/[^\.]+(\.app|CodePush|.*(?=\/))/, "");
 // Add additional regex here to fix the `at` issue

      const appPrefix = "app://";
      // We always want to have a tripple slash
      frame.filename =
        frame.filename.indexOf("/") === 0
          ? `${appPrefix}${frame.filename}`
          : `${appPrefix}/${frame.filename}`;
    return frame;

  dsn: "your DSN",
  integrations: [rewriteFramesIntegration],

Hope that helps.

1 Like

Thanks. I’ve got another question and I’m wondering if it’s related to the rewriteFramesIntegration change. The new build of our Android app, which includes the rewriteFramesIntegration change and is using RN Sentry 1.0.6 instead of RN Sentry beta 1.0.0-beta.6, is reporting a bunch of events that look like this:

{ NativeMap: {"stringified":"TypeError: Network request failed","name":"TypeError","message":"Network request failed","stack":["TypeError: Network request failed","    at S.y.onerror (mailworker.bundle:209:7272)","    at S.dispatchEvent (mailworker.bundle:198:5672)","    at S.value (mailworker.bundle:197:6082)","    at S.value (mailworker.bundle:197:2822)","    at mailworker.bundle:197:5019","    at p.value (mailworker.bundle:129:1275)","    at c.value (mailworker.bundle:108:3513)","    at mailworker.bundle:108:808","    at c.value (mailworker.bundle:108:2771)","    at c.value (mailworker.bundle:108:787)"],"error":{}} }

Why would some events be reported as NativeMap objects like this? This particular event includes a stack trace but it’s not formatted in the way I would expect, and it’s not symbolicated (the mailworker.bundle and its sourcemap were uploaded when the app was built).

We also seem to be missing stack traces for some errors that included stack traces in our last build. Here’s an example.

This event has a symbolicated stack trace (although not a very useful one). This one does not. The build in the first error is using RN Sentry 1.0.0-beta.6, without this rewriteFramesIntegration change. The build in the second error is using RN Sentry 1.0.6 with V8 and the rewriteFramesIntegration change.