sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Missing a uninstall guide

Open sboudouk opened this issue 4 years ago • 9 comments

OS:

  • [ ] Windows
  • [X] MacOS
  • [ ] Linux

Platform:

  • [X] iOS
  • [X] Android

SDK:

  • [X] @sentry/react-native (>= 1.0.0)
  • [ ] react-native-sentry (<= 0.43.2)

SDK version: 1.0.9

react-native version: 0.0.0

Are you using Expo?

  • [ ] Yes
  • [X] No

Are you using sentry.io or on-premise?

  • [X] sentry.io (SaaS)
  • [ ] on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

None of both propositions.


I have following issue:

I am on a new project and I need to uninstall Sentry from it, since there is really a strange issue with sentry using old project crendentials that I won't bother you with.

I want to completly remove sentry from my react-native project. sentry-wizard -uninstall did not do the trick since I still have build issues related to sentry.

It would be great to have a clean uninstall guide. Thanks.

sboudouk avatar Oct 23 '20 14:10 sboudouk

Agree!

Im trying

  1. npx react-native unlink @sentry/react-native And as result I'm receiving:
Running Sentry Wizard...
version: 1.1.4 | sentry-cli version: 1.59.0
😢  Successfully removed Sentry from your project 😢
  1. After that I run: npm uninstall @sentry/react-native
  2. And manually deleted ios/sentry.properties & android/sentry.properties
  3. Then I remove ios/Podfile.lock and run npx pod-install
Downloading dependencies
Removing Sentry
Generating Pods project
  1. Finally removed the references to sentry library from my code base

crisecheverria avatar Nov 30 '20 14:11 crisecheverria

On IOS, also need to check on the Build Phases> "Bundle React Native code and images" script. Rollback to before adding sentry. On my case, IOS build (production) will crash because it can not find the react native bundle file.

pentolbakso avatar May 05 '21 05:05 pentolbakso

Hello @pentolbakso. Do you remember how that Build Phase was prior to adding Sentry? I'm not entirely sure what I should revert there. I'm having the same issue on my side, where a build from TestFlight just hangs there without loading the app (I presume it's the same issue you had).

luispinho avatar Aug 02 '21 15:08 luispinho

@luispinho sorry, I don't remember.. may be u could use git history for comparison

pentolbakso avatar Aug 04 '21 06:08 pentolbakso

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Nov 04 '21 15:11 github-actions[bot]

I don't think I'll ever be using sentry again due to this issue. Very bad setup process and horrible lock in.

JoshPolaris avatar Feb 09 '22 12:02 JoshPolaris

@JoshPolaris sorry to hear that, have you tried https://github.com/getsentry/sentry-react-native/issues/1139#issuecomment-735813760 ? That should be enough.

marandaneto avatar Feb 09 '22 14:02 marandaneto

@JoshPolaris sorry to hear that, have you tried #1139 (comment) ? That should be enough.

That didn't fix it, I had to edit project.pbxproj and manually remove every sentry associated file. I almost lost my project in the process

JoshPolaris avatar Feb 17 '22 09:02 JoshPolaris

Besides removing @sentry/react-native and its dependencies, all the imports and calls to the Sentry SDK in your code, you have to undo the patched files for automatic source maps upload https://docs.sentry.io/platforms/react-native/sourcemaps/#2-disable-the-automatic-source-maps-upload-script Nothing else should be needed.

marandaneto avatar May 11 '22 09:05 marandaneto

Also https://github.com/getsentry/sentry-react-native/issues/2596#issuecomment-1301342103

marandaneto avatar Nov 04 '22 08:11 marandaneto

Besides removing @sentry/react-native and its dependencies, all the imports and calls to the Sentry SDK in your code, you have to undo the patched files for automatic source maps upload https://docs.sentry.io/platforms/react-native/sourcemaps/#2-disable-the-automatic-source-maps-upload-script Nothing else should be needed.

I regret installing Sentry and will never touch it again. What a mess it caused.

Could you please give us steps 1.2.3. on how to do what you just described above?

"you have to undo the patched files for automatic source maps upload https://docs.sentry.io/platforms/react-native/sourcemaps/#2-disable-the-automatic-source-maps-upload-script"

How do I undo the patched files for automatic source maps upload?

henryverlin avatar Jan 26 '23 21:01 henryverlin

Besides removing @sentry/react-native and its dependencies, all the imports and calls to the Sentry SDK in your code, you have to undo the patched files for automatic source maps upload https://docs.sentry.io/platforms/react-native/sourcemaps/#2-disable-the-automatic-source-maps-upload-script Nothing else should be needed.

I regret installing Sentry and will never touch it again. What a mess it caused.

Could you please give us steps 1.2.3. on how to do what you just described above?

"you have to undo the patched files for automatic source maps upload https://docs.sentry.io/platforms/react-native/sourcemaps/#2-disable-the-automatic-source-maps-upload-script"

How do I undo the patched files for automatic source maps upload?

In case someone else finds the instructions a bit hard to follow. Here is what I did to get my project working again:

Before the below list I guess I did the following from other comments here: -> npx react-native unlink @sentry/react-native -> npm uninstall @sentry/react-native -> manually deleted ios/sentry.properties & android/sentry.properties -> Removed ios/Podfile.lock and run npx pod-install -> Removed the references to sentry library from my code base

Then still not working, I had to do the following:

1. Go to file: ./ios/ProjectName.xcodeproj/project.pbxproj

2. Find: /* Begin PBXShellScriptBuildPhase section */

3. Look for row:
shellScript = "export EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nset -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\n../node_modules/@sentry/cli/bin/sentry-cli react-native xcode REACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n\n";

4. Replace it with this (or whatever your git version before the sentry was):
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";

5. Then noticed Metro was failing due to missing launch command or so, -> Fixed by removing node_modules with: 'rm -rf node_modules/'

6. Yarn install to get things working again.

I guess this is how you "just undo the patched files for automatic source maps upload". ...

Isn't it a bit bad practice to alter project files when installing Sentry, and then not cleaning up the changes on uninstall? 👎

henryverlin avatar Jan 26 '23 22:01 henryverlin

All you need to do is here: https://docs.sentry.io/platforms/react-native/uninstall/ which is just 2 CLI calls, have you tried that?

marandaneto avatar Jan 27 '23 14:01 marandaneto