React-Native: Source code was not found

Hi,

We’re using Sentry with React-Native and are having problems with our sourcemap on iOS.

This is the error we’re getting:
Source code was not found for /Frameworks/SalesflowReactKit.framework/main.jsbundle Collapse { "url": "/Frameworks/SalesflowReactKit.framework/main.jsbundle" }

The actual javascript error:
ReferenceError Can't find variable: force_crash /Frameworks/SalesflowReactKit.framework/main.jsbundle at line 369:2549

Artifacts look like this:

As you can see we’re using a slightly different setup where we’re including ReactNative in a framework in our app, so main.jsbundle is not in the root of the application bundle.

To upload the sourcemap we use these commands:

sentry-cli releases --org ORG --project PROJECT files RELEASE upload-sourcemaps --url-prefix "/Frameworks/SalesflowReactKit.framework/" main.jsbundle.map

and:

sentry-cli releases --org ORG --project PROJECT files RELEASE upload-sourcemaps --url-prefix "~/Frameworks/SalesflowReactKit.framework/" main.jsbundle.map

(not sure if we need to prefix absolute path or with ~ so trying both)

Things we’ve checked:

  • JS error was generated after uploading the sourcemaps
  • JS error occurs in same release version as where we upload the artifacts
  • main.jsbundle has //# sourceMappingURL=main.jsbundle.map

Is there something we’re doing wrong?
Any help greatly appreciated!

1 Like

Hey

We are currently working on a react-native package which is almost ready for beta testing, we will release it probably in the next one or two weeks. This package will support everything out of the box and also shows you mixed stacktraces (JS/Native).

So stay tuned for that …

Until then try the following:

--url-prefix="/" --rewrite --strip-common-prefix

Add these 3 options for uploading the source maps, this should fix the problem.
This will rewrite the sourcemap and fix the sourceMappingURL in it.
Also try --url-prefix="~" and let me know if this fixed the problem for you.

1 Like

Hi,

Thanks for your answer, I tried your suggestions but unfortunately I still get the same error.

These are the commands I use for uploading:

sentry-cli releases --org ORG --project PROJECT files RELEASE upload-sourcemaps --url-prefix="/" --rewrite --strip-common-prefix main.jsbundle.map

and:

sentry-cli releases --org ORG --project PROJECT files RELEASE upload-sourcemaps --url-prefix="~" --rewrite --strip-common-prefix main.jsbundle.map

This is the error I get on sentry:

and:

Do you have any other suggestions on why this is not working?

Thanks!

ps. where would this (beta) react-native package be announced? Is it already available on Github?

1 Like

Os objectivos que querem alcançar estão a critério do dentro e fora a sua ajuda e preciosa

Toda a ajuda da sentença e preciosa

We released our react-native client right now …

Maybe give it a try.

1 Like

Thanks, will try that!

1 Like