I came across the following error while trying to uninstall an unused Ionic Native plugin from an iOS project I was developing:
Error during processing of action! Attempting to revert... Error: Uh oh! Path must be a string. Received undefined
Don't you just hate it when error messages leave you even more confused as to what is broken and why?
Thankfully fixing this with the Ionic CLI is quite straightforward.
The fix is on
Start by un-installing and re-installing the iOS platform for the project:
ionic platform rm ios ionic platform add ios
This is then followed by removing the offending plugins (and all of its related plugins - if any), like so:
ionic plugin rm cordova-plugin-googlemaps ionic plugin rm com.googlemaps.ios
Before finally un-installing the associated Ionic Native package(s) from NPM:
npm uninstall --save @ionic-native/google-maps
The --save flag will also remove the entry for that plugin from the project's package.json file.
IMPORTANT: IF you used the cordova command line to install a plugin that you're looking to remove then you'll need to issue commands through that particular tool instead of the Ionic CLI.
Hopefully, if you're experiencing a similar issue with uninstalling plugins, the above steps will help fix the problem.
I've yet to meet a developer who enjoys being greeted with broken code and cryptic error messages, particularly when those error messages aren't very helpful in providing clues as to why things aren't working.
Fortunately, or ironically, depending how you look at it, un-installing and re-installing the target platform allowed the plugin to be subsequently un-installed.
If you enjoyed or found useful what you've read here then please sign up to my mailing list and, if you haven't done so already, take a look at my e-book: Mastering Ionic for information about troubleshooting further issues when developing with the Ionic Framework and Ionic Native/Cordova plugins.