OS:
_Platform:_
Output of node -v && npm -v && npm ls --prod --depth=0
v8.5.0
5.4.2
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (git://github.com/doochik/react-native-appmetrica.git#eae1237a98a23671655f300ab429c8f567b57d86)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
Config:
// I use default config
Sentry.config('https://[email protected]/...', {}).install()
I have following issue:
Sentry doesn't expand error stacktrace and I see processing error "Source code was not found for app:///main.jsbundle".
At release tab I see that sourcemaps are uploaded with names ~/main.jsbundle and ~/main.jsbundle.map, not "app:///main.jsbundle".
Is this bug or I've missed something in Sentry config?
I use Sentry 8.19.0
That should be fine, ~/ will be matched to the app:/// prefix.
Can you link to an event so I can take a look at it?
Sorry, my Sentry installation is private.
May be I can provide some additional info?
The release/dist also have to match in order for Sentry to symbolicate the frames correctly.
I'm having the same issue here, but when I build a release build via xcode, it looks like my sourcemap doesn't get uploaded to the version I want.
My Bundle React Native code and images build phase has the correct commands from running react-native link.
Any reason why my sourcemaps aren't uploading?
Edit: I just found out that because I'm using codepush, the errors being logged and the source maps being uploaded are on the wrong release. How do I resolve this?
@swl367 https://docs.sentry.io/clients/react-native/codepush/
Also you have to upload source file + sourcemap by yourself with sentry-cli
@HazAT That's where I'm having trouble. If I upload the sourcemap using rewrite, strip-common-prefix, and the other commands, I still see the "cannot find source for app:///mainbundle.js" error.
I guess I've been uploading the sourcemap, but what's the correct way to upload the files?
$ sentry-cli releases files VERSION upload /path/to/file '~/file.js'
What is the path to file and filejs here?
Any ideas on that? I appreciate your input here.
@swl367 I've just updated our docs and fixed bunch of stuff.
https://docs.sentry.io/clients/react-native/codepush/
Also make sure to use the latest sentry-cli version 1.20 which soon will be released.
@doochik To clear things up, your upload looks fine but you have to make sure that your event version matches the release on the server where you uploaded the sourcemaps.
@HazAT Right now in Sentry I see full path to main.jsbundle (/Users/development/Library/Developer/CoreSimulator/Devices/2E07D1E4-2C5F-4B9C-844F-F05443C2D3E7/data/Containers/Bundle/Application/AEFD1C68-0E1C-4160-AD1A-39B9231E29B4/Application.app/main.jsbundle)
Artifacts for this release uploaded with names (~/main.jsbundle and ~/main.jsbundle.map), but it not matched with full path and logs are not parsed. Any idea?
@valeryq Which version of react-native-sentry are you using. It should not upload frames with the full path it should look like app:///main.jsbundle.
If release a fix for this in the latest version, make sure to upgrade.
@HazAT I'm using pure raven-js, but earlier it worked correctly :) Maybe you have some tips for me?
@valeryq I would use react-native-sentry, and if you are not comfortable with using the native integration you can just disable it (I do not recommend doing so)
Sentry.config('DSN', {
disableNativeIntegration: true,
}).install();
There are so many things to consider when running a react-native app, we do no longer support using just raven-js without react-native-sentry
@HazAT so, I switched to react-native-sentry, and after that I really see app:///main.jsbundle in logs, great. But can I specify release name manually from JS client? And can I disable automatic sourcemap handling?
@valeryq There are:
Sentry.setRelease(release);
Sentry.setDist(dist);
Sentry.setVersion(version);
try out which fits your needs.
What do mean with automatic source map handling? If you don't want to upload source maps you can remove the run script from Xcode or gradle plugin from your android project.
@HazAT super, it's working, but only need to upload sourcemaps via sentry-cli (it convert map file) and then it will be working as expected! Great! Thanks for the fast answer!
@HazAT How would the documentation work for android codepush?
$ code-push release-react YourApp ios --outputDir build
$ export SENTRY_PROPERTIES=./ios/sentry.properties
$ sentry-cli react-native codepush YourApp ios ./build
Would we replace all of the 'ios' with 'android'?
@swl367 right, that should do it
@HazAT I'm having issues with pushing a code-push release to prod. When my account shows 0 releases, I expect v1 to be the latest code push release.
However, when I run the commands in the documentation, I get the following output:
Fetching latest code-push package info
Processing react-native code-push sourcemaps
Analyzing 2 sources
Rewriting sources
Adding source map references
Uploading source maps for release com.app.id-0.1.1-codepush:v3
Source Map Upload Report
Minified Scripts
~/main.jsbundle (sourcemap at main.jsbundle.map)
Source Maps
~/main.jsbundle.map
Any ideas? My staging environment has versions up to v3, but prod does not.
I'm currently using the latest version of sentry-cli (1.21.0)
@swl367 @HazAT I had the same issue, source map just not work
I'm using sentry-cli 1.32.0.
sentry-cli releases files 1.0.0 upload-sourcemaps --url-prefix "app://" index.android.bundle index.android.bundle.map
Analyzing 2 sources
Adding source map references
Uploading source maps for release 1.0.0
Source Map Upload Report
Minified Scripts
app:/index.android.bundle (sourcemap at index.android.bundle.map)
Source Maps
app:/index.android.bundle.map
How can I add the prefix "app://"? It seems just to be ignored.
@Kinka should be: --url-prefix "~"
Also make sure you properly set up the sdk.
@HazAT thanks, I'll have a try.
Hi, for Android, it works well for me.
Like that:

But for iOS, it can not get the source map

Any idea @HazAT ?
I have another script already:
export SENTRY_PROPERTIES=sentry.properties
../../node_modules/@sentry/cli/bin/sentry-cli upload-dif "$DWARF_DSYM_FOLDER_PATH"
@HazAT I have to mention again that the source and sourcemap file both need to be uploaded.
Any progress ? @tangnv did you solve this problem ?
Getting the same @ysfzrn @tangnv -- any ideas?
Actually, I have reset my changes and I have reinstalled carefully according to docs and it worked. I don't know what's the reason for this error.
@ysfzrn Ah, interesting. Did you install manually or via CocoaPods? Which version of react native are you on?
Would you mind elaborating on your workflow?
Right now I’m doing this (after a Cocoapods install and setup per the docs, on RN 0.61.5):
// codepush
appcenter codepush release-react --app <app name> --mandatory --deployment-name Production --output-dir ./src/build/ios --sourcemap-output-dir ./src/build/ios
// upload to sentry
SENTRY_PROPERTIES=./ios/sentry.properties sentry-cli react-native appcenter --deployment Production --org=<mysentryorg> --project=<mysentryproject> ios ./src/build/ios
Thanks!
Most helpful comment
@HazAT I'm having issues with pushing a code-push release to prod. When my account shows 0 releases, I expect v1 to be the latest code push release.
However, when I run the commands in the documentation, I get the following output:
Source Map Upload Report
Minified Scripts
~/main.jsbundle (sourcemap at main.jsbundle.map)
Source Maps
~/main.jsbundle.map
Any ideas? My staging environment has versions up to v3, but prod does not.
I'm currently using the latest version of sentry-cli (1.21.0)