sentry-react-native: CodePush iOS/Android with Hermes showing wrong line numbers RN0.68/Sentry SDK7/Self-Hosted 22.5.0
OS:
- Windows (not tested as we don’t use Windows)
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@sentry/react-native
(>= 1.0.0)
{
"dependencies": {
"react-native": "^0.68.2",
"@sentry/react": "^7.6.0",
"@sentry/react-native": "^4.1.2",
"@sentry/tracing": "^7.6.0"
},
"devDependencies": {
"@sentry/types": "^7.6.0",
"@sentry/webpack-plugin": "^1.18.9"
}
}
react-native
version: 0.68.2
Are you using Expo?
- Yes
- No
Are you using sentry.io or on-premise?
- sentry.io (SaaS)
- on-premise v22.5.0
If you are using sentry.io, please post a link to your issue so we can take a look:
NA
Configuration:
import { Platform } from 'react-native'
import CodePush from 'react-native-code-push'
import { env } from 'libs/environment'
import { version, build } from '../../../package.json'
export async function getSentryConfig() {
let update
try {
update = await CodePush.getUpdateMetadata()
} catch (error) {
// silent fail
}
let release = `${version}-${Platform.OS}`
if (update) {
release += `+codepush:${update.label}`
}
const dist = `${build}-${Platform.OS}`
return {
dsn: env.SENTRY_DSN,
environment: env.ENV,
release,
dist,
}
}
I have following issue:
Following https://github.com/getsentry/sentry-react-native/issues/2244 and https://github.com/getsentry/sentry-react-native/issues/2087 closed too early, this is how we generate the sourcemaps, we used all of your recommendations, but still can’t use source map with Android/iOS app after code push, which we often use.
iOS hard and android Hard work fine since your last investigation regarding iOS and Android matter, but this is what code push does.
Steps to reproduce: :
- Step 1: create a build hard iOS or Android published on appcenter or stores
- Step 2 : update the code base and provide change through app center code push
- Step 3 : manually generate sourcemaps and upload them to sentry with a custom
dist
andrelease
pair - Step 4 : send an error to sentry
Actual result:
iOS
Android
Expected result:
We expect to see proper sourcemaps line as for our iOS and Android hard build
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (5 by maintainers)
Commits related to this issue
- Describe --version-name for iOS Solution given by @marandaneto https://github.com/getsentry/sentry-react-native/issues/2372#issuecomment-1194020493 — committed to kopax-polyconseil/sentry-docs by kopax-polyconseil 2 years ago
- CodePush: do not upload manually source maps Solution given by @marandaneto https://github.com/getsentry/sentry-react-native/issues/2372#issuecomment-1191103821 We tested it and it gives wrong sou... — committed to kopax-polyconseil/sentry-docs by kopax-polyconseil 2 years ago
Hi @kopax-polyconseil first of all, thank you for sharing your solution.
Very dark waters with
appcenter-cli
. The guilty was indeed the cli from appcenter not creating correctly/index.android.bundle
and/index.android.bundle.map
files.With
"react-native": "0.70.4",
I had to use the version"appcenter-cli": "2.11.0"
So what did you have to do to get it working? 😃
@kopax-polyconseil
Solution can be found on this repo : https://github.com/pass-culture/pass-culture-app-native
Glad you find the solution, but can you share it ? I’m reading this thread (and others) for 15 min and I can’t find a solution
Version name comes from appcenter and has the
{}@{}+codepush:{}
pattern. https://github.com/getsentry/sentry-cli/blob/e08e7c31d93a29797edf7d1e5ec42ee0453ecc49/src/utils/appcenter.rs#L191-L194 It should be the value within the 2nd{}
. On iOS, this is defined here e.g. https://github.com/getsentry/sentry-react-native/blob/abc947fd04033997fd431c3ea09196718b60b872/sample/ios/sample/Info.plist#L19-L20 So its the same value asCFBundleShortVersionString
Thanks for raising. There has been some changes recently in Hermes, that might be the cause. We’ll need to look into this before we can get back to you.