Closed Alqasrawi closed 6 years ago
Hi there, I just edited this for you. Try not to post your DSN on GitHub.
Should I upload the bundle and the source map manually to sentry ? is there any other information I should provide with the ticket ?
I tried uploading the bundle and the source map manually and I got a "Invalid token (401)" error
Command used to generate the bundle and the source map:
react-native bundle --platform android --entry-file index.js --bundle-output <path-to-assets>/index.bundle --sourcemap-output <path-to-assets>/index.bundle.map --assets-dest <path-to-resources> --dev false
Command used to upload the bundle and the source map to sentry:
./node_modules/.bin/sentry-cli --auth-token <auth-token> --url http://sentry.mm.taou.com releases -o <organization-name> -p <project-name> files 6.7 upload-sourcemaps --rewrite --validate <path-to-assets>/index.bundle <path-to-assets>/index.bundle.map --strip-prefix <path-to-assets>/
Hey, so it seems like you are using the wrong Auth Token.
This is not your DSN, did you call react-native link react-native-sentry
?
This command should start the wizard and help you with the setup.
You can find your auth token here:
https://sentry.io/settings/account/api/auth-tokens/
Thanks for the reply, I managed to execute the upload command with the correct information, the files are uploaded now to sentry.io but I still get this error on sentry:
Source code was not found for app://index.bundle
the build artifacts names are the following:
~/index.bundle
~/index.bundle.map
Can you link an event here so I can take a look at it?
As mentioned in Issue 338 I forgot to add the RNSentryPackage:
reactInstanceManager = ReactInstanceManager.builder()
.setApplication(getActivity().getApplication())
.addPackage(new MainReactPackage())
.addPackage(new RNSentryPackage(null))
.......
.build();
P.S: I am integrating react native in an existing Android app, the react instance is managed inside a fragment, I didn't need to implement ReactApplication anywhere, I checked the source code for RNSentryPackage and the ReactApplication constructor argument is never used in the code. that's why I used null in the constructor.
@Alqasrawi are you able to get the line number on sentry. I need a serious help on this, but no one on the forums helping. Even the sentry people are not helping 👎
@vivek-walecha-657 Hey, no reason to be upset, I see your comment for the first time :)
What command are you running to upload the source maps? This error indicates that they are not uploaded?
Which version of react-native-sentry
are you running?
Can you link me to one of your issues so I can take a look in your account?
org = sharek project = react-native architecture = ios
@HazAT I have successfully generated sourcemaps via:-
react-native bundle --platform ios --entry-file index.js --dev true --bundle-output ./index.bundle --assets-dest ./dist/sourcemap.js
And then uploaded the generated sourcemap.js to sentry (this works)
sentry-cli releases files BUILDNAME upload-sourcemaps ./dist/ --dist BUILDNUMBER --strip-prefix ABSOLUTE_PATH_TO/index.js --no-rewrite
But still in the sentry console it tells me via sentry web portal Source code was not found for app:///index.bundle
.
What am I doing wrong please?
EDIT I am using codePush so I am now following the instructions for that: https://docs.sentry.io/clients/react-native/codepush/
I am still seeing the error Source code was not found for app:///index.bundle
.
I have now set up the codePush metadata hook as per
codePush.getUpdateMetadata().then(update => {
if (update) {
Sentry.setVersion(update.appVersion + '-codepush:' + update.label)
}
})
and
The following command is successful:-
sentry-cli react-native appcenter APPCENTER_ID ios ./build/codePush
> Fetching latest AppCenter deployment info
> Processing react-native AppCenter sourcemaps
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
> Uploading source maps for release com.fake_domain.FakeApp.ios-0.23-codepush:v59
Source Map Upload Report
Minified Scripts
~/main.jsbundle (sourcemap at main.jsbundle.map)
Source Maps
For me, this https://github.com/getsentry/sentry-cli/issues/233 helped, as the path I was using was just ./build
and the correct one to use was ./build/codePush
.
OS:
Platform:
Output of
node -v && npm -v && npm ls --prod --depth=0
Config:
I have following issue: I get the "Source code was not found for app:///index.bundle" error on sentry.io dashboard
I added sentry to my react native app inside an existing Android app, I used the react-native link react-native-sentry command to integrate sentry in the project and I added:
to app/build.gradle
The map file isn't uploaded to sentry and therefore the code is not reported with the crashes, only the stack trace.
Steps to reproduce:
Actual result:
Expected result: