Stack traces are inconsistent and sometimes wrong

I’m having a weird issue with the stack traces for our iOS React Native app. The same errors in the same iOS distribution and version sometimes have different stack traces when viewed in Sentry. Sometimes the stack traces are correct, but sometimes they are completely wrong and make no sense at all. Here’s an example. The first link has a correct stack trace. The second link is showing some unrelated files:

Why is this happening and how can I fix it?

Can you please not post the share links, we can’t inspect what’s going on there?!

Which links do you need? Do these work for you?

Yes, these help thx.
OK this is really odd, I’ve never seen this before also since the crash seems to be from the same device. Which react-native version are you using?
Also, if you have time you could try our new SDK

It changes a lot of the internals, I would be curious if this also happens there.
Anyway, thanks for bringing this up, if you are aware how to reproduce this let me know.

This build was using RN 0.60.3. Right now we’re on RN 0.60.4. I can try updating to the latest SDK and see if that makes any difference.

Here’s another weird one:

This error is being reported for distribution 172, and there’s a stack trace visible, but I don’t think we ever actually uploaded a main.jsbundle or sourcemap for this distribution. Our CircleCI job, which handles this, failed just after uploading that build to Testflight but before any of the source files or sourcemaps had been uploaded to Sentry, so I’m not sure where the stack trace I’m seeing is actually coming from. I looked over our artifacts for that release and don’t see anything for 172 in there either:

The update to the RN beta doesn’t seem to have made any difference. Here’s an example of a bad stack trace from Sentry RN 1.0.0-beta 6:

Can you tell if the line reported is even remotely close to the crash that caused it?
Also, are you using typescript?

Yes, we’re using Typescript. Whether the line reported is close to the actual error varies. I think in this example the actual line that caused the error might be two lines under what Sentry is pointing to. But in this one, the lines that Sentry is pointing to aren’t even close to where the error actually came from: It’s showing a stack trace from one of the libraries we’re using when that’s an error that’s being thrown from within our code.