question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sentry doesn't work when Code-Push on my app.

See original GitHub issue

Environment

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:closed
  • Created 2 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dkahdwkcommented, Jan 19, 2022

@jennmueng

I feel dejected… It was solved when I changed enable Native to true…

        Sentry.init({
            ...
            enableNative: true,
        });

You helped me so kindly. It gave me strength!

0reactions
dkahdwkcommented, Jan 20, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found