Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove a plugin using a not officially supported platform #850

Open
3 tasks done
Offpics opened this issue Aug 19, 2020 · 1 comment
Open
3 tasks done

Comments

@Offpics
Copy link

Offpics commented Aug 19, 2020

Bug Report

Problem

I am unable to remove a custom plugin using cordova plugin remove plugin-name for not officially supported platform.

What is expected to happen?

The plugin should be removed from the project.

What does actually happen?

CLI throws an error: Platform "platform-name" not supported..

Information

Looking at source code, the plugin remove command calls function uninstallPlatform in cordova-lib/src/plugman/uninstall.js. The error I get comes from

if (!platform_modules[platform]) {
return Promise.reject(new CordovaError('Platform "' + platform + '" not supported.'));
}

platform_modules are defined inside https://github.com/apache/cordova-lib/blob/master/src/platforms/platformsConfig.json. It makes sense it's not modified when I add the custom platform to the project.
This part of the code probably should not depend on the static configuration.

Command or Code

cordova plugin remove plugin-name --verbose
Calling plugman.uninstall on plugin "plugin-name" for platform "platform-name"
Platform "platform-name" not supported.
CordovaError: Platform "platform-name" not supported.
    at Function.module.exports.uninstallPlatform (...\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\uninstall.js:71:31)
    at ...\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\plugin\remove.js:106:38
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Version information

Cordova: 10.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@Offpics Offpics changed the title Unable to remove a plugin using a not officialy supported platform Unable to remove a plugin using a not officially supported platform Aug 19, 2020
@brodycj
Copy link
Contributor

brodycj commented Aug 19, 2020

Thanks, this definitely needs investigation. A PR with proper test cases would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants