Sentry doesn't work when Code-Push on my app.
See original GitHub issueEnvironment
Which SDK and version?
@sentry/react-native: 3.2.10
Steps to Reproduce
When applied with a code push, the centry does not work. I followed the guide, but the problem still remains…
my code:
useEffect(() => {
const checkAndGetCodePush = async () => {
try {
let result = await CodePush.checkForUpdate();
if (result) {
setIsUpdating(true);
CodePush.sync(
{
installMode: CodePush.InstallMode.IMMEDIATE,
mandatoryInstallMode: CodePush.InstallMode.IMMEDIATE
},
async (status) => {
switch (status) {
case CodePush.SyncStatus.DOWNLOADING_PACKAGE:
break;
case CodePush.SyncStatus.INSTALLING_UPDATE:
break;
case CodePush.SyncStatus.UPDATE_INSTALLED:
// Sentry
await CodePush.getUpdateMetadata().then(update => {
if (update) {
Sentry.init({
environment: 'production',
dsn: myDsn,
tracesSampleRate: 1.0,
enableNative: false,
release: `${update.appVersion}+codepush:${update.label}`,
dist: update.label,
});
}
});
setIsUpdating(false);
break;
case CodePush.SyncStatus.SYNC_IN_PROGRESS:
break;
}
},
(progress) => {
setSyncProgress(progress);
},
);
} else {
await CodePush.getUpdateMetadata().then(update => {
if (update) {
Sentry.init({
environment: 'production',
dsn: myDsn,
tracesSampleRate: 1.0,
enableNative: false,
release: `${update.appVersion}+codepush:${update.label}`,
dist: update.label,
});
}
});
setIsUpdating(false);
}
} catch (err: any) {
setIsUpdating(false);
}
}, []);
....
return Sentry.wrap(codePush(codePushOptions)(App));
Action code push(android):
appcenter codepush release-react -a [name]/[app_name-android] -d Production --sourcemap-output --output-dir ./build
Currently, Sentry is not sending issues in my app. However, except for the Code-Push, the sentry operate normally. I don’t know what the problem is with the code…
Expected Result
What you thought would happen.
Actual Result
What actually happened. Maybe a screenshot/recording? Maybe some logs?
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Sentry is not working with code push
I am using sentry and code push in my application. I am getting crash while trying to log message in sentry.
Read more >react-native-code-push + react-native-sentry don't update ...
I use Sentry + code push in ma project but my push code install is causing problem.... On a version in test flight,...
Read more >How to setup React-Native + Microsoft CodePush with Sentry ...
On the react-native code. The first step is to install Sentry SDK on your react-native project, you can achieve this running the above...
Read more >How we reduced the codepush bundle size by 85% - Bam Tech
“Codepush does not work in the app ! ... when you are debugging, or you upload it on your monitoring tool (like Sentry,...
Read more >React Native - Sentry Documentation
If you are using expo-cli you need to use another SDK see: https://docs.expo.io/versions/latest/guides/using-sentry/ This SDK only works for ejected projects or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jennmueng
I feel dejected… It was solved when I changed enable Native to true…
You helped me so kindly. It gave me strength!
@jennmueng Yes, in my case, I tested the code push more than 100 times. So I can be sure. When enableNative was false, it could not be uploaded to the sentry release, but when true, it immediately went up to the release and issues were printed.