sentry-react-native: Problem since artifact bundles introduced
OS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@sentry/react-native
(>= 1.0.0) -
react-native-sentry
(<= 0.43.2)
SDK version: 5.3.0
react-native
version: 0.70.9
Are you using Expo?
- Yes
- No
Are you using sentry.io or on-premise?
- sentry.io (SaaS)
- on-premise
If you are using sentry.io, please post a link to your issue so we can take a look:
- https://catenda-as.sentry.io/share/issue/79b88509ca9047aa843334447638b7a2/
- https://catenda-as.sentry.io/share/issue/ac24e9b6020648fe919ec2ff402ed4b1/
Configuration:
(@sentry/react-native
)
Sentry.init({
dsn: 'https://...@sentry.io/...'
maxValueLength: 1024
});
I have following issue:
When a line of javascript causes an error to be logged to Sentry separate issues are created per platform.
Steps to reproduce:
- Log an error to sentry from javascript
Actual result:
- One issue on iOS with the correct line of javascript highlighted in the source code.
- One issue on Android with the incorrect line of javascript highlighted in the source code.
Expected result:
- One issue with multiple events covering both iOS and Android and the correct line of javascript highlighted in the source code.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 38 (20 by maintainers)
I am off for the next two weeks but will follow up once I’m back.
@markholland Thank you for the summary, I’m happy that it works for you and I’m sorry for the long debugging.
One note
The Envs defined here are passed to the app process not to the environment during the build. That’s why they are not picked up by the
sentry-cli
.@stachu2k You can have more than 2 artifacts for one release but it’s important to use unique dist values for the different artifacts so we are able to select the correct one for the incoming error.
But seem like that was a mistake anyway, happy to hear it works now.
@krystofwoldrich Now the command worked. It has shown a correct stack trace for my test error. The funny thing is that I had trouble to identify the correct artifact associated to 2.13.0 (77) because it turned out to have 22 artifacts instead of 2. So I bumped versionCode to 78 and built a fresh release 2.13.0 (78) with only 2 artifacts uploaded to Sentry. Then I pressed a button to send my test error and now I see that stack trace is correct as seen on the screenshot. So I think the issue is somehow solved. Is it necessary to have only 2 artifacts per release?
Ok, I’ll give this a go.
It still feels like this needs to be better explained in the documentation because if you’re using React Native it is quite possible you’re targeting multiple platforms so this would be a required step. Also when looking at the current documentation setting
dist
is part of the manually uploading source maps section which leads to it not being clear that you don’t actually need to switch to manual upload.Thanks for all the help and fast responses. I’ll close this once we have it working again.
@krystofwoldrich