sentry-react-native
sentry-react-native copied to clipboard
Missing a uninstall guide
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.
Agree!
Im trying
-
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 😢
- After that I run:
npm uninstall @sentry/react-native
- And manually deleted ios/sentry.properties & android/sentry.properties
- Then I remove ios/Podfile.lock and run npx pod-install
Downloading dependencies
Removing Sentry
Generating Pods project
- Finally removed the references to sentry library from my code base
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.
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 sorry, I don't remember.. may be u could use git history for comparison
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 🥀
I don't think I'll ever be using sentry again due to this issue. Very bad setup process and horrible lock in.
@JoshPolaris sorry to hear that, have you tried https://github.com/getsentry/sentry-react-native/issues/1139#issuecomment-735813760 ? That should be enough.
@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
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.
Also https://github.com/getsentry/sentry-react-native/issues/2596#issuecomment-1301342103
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?
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? 👎
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?