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

Cordova does not support subfolders, when using semver #795

Closed
3 tasks done
alex-jesper opened this issue Oct 9, 2019 · 0 comments · Fixed by #827
Closed
3 tasks done

Cordova does not support subfolders, when using semver #795

alex-jesper opened this issue Oct 9, 2019 · 0 comments · Fixed by #827
Labels

Comments

@alex-jesper
Copy link

alex-jesper commented Oct 9, 2019

Bug Report

I get "Error: Cordova does not support subdirectories" when a plugin is installed.

Discovered saved plugin "project". Adding it to the project
Failed to restore plugin "project" from config.xml. You might need to try adding it again. Error: Cordova does not support subdirectories

Problem

The plugin is in package.json, according to correct syntax:

"dependencies": {
    "project": "https://bitbucket.org/project.git#semver:~0.1.1"
}

And in config.xml:

<plugin name="project" />

What does actually happen?

I get the subfolder error because cordova is confused by the ":".
The comment in src/plugman/fetch.js::57, seems to hit the nail on the head

// If the hash exists, it has the form from npm: http://foo.com/bar#git-ref[:subdir]

So the ":" implies that a subfolder should be used, but in this case it is indicating to npm to use semver to resolve.

What is expected to happen?

I was expecting cordova to understand semver

Funny detail

In plugins it is possible to use semver. That is, the plugin.xml depends on a module from npm that has a similar url with a ":", but in that context it works just fine.
Only visible difference is that one file is plugin.xml while the other is config.xml.

Information

Command or Code

NA

Environment, Platform, Device

NA

Version information

Cordova 9.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
@raphinesse raphinesse added the bug label Nov 7, 2019
raphinesse added a commit to raphinesse/cordova-lib that referenced this issue Nov 21, 2019
AFAICT, the check that is removed here was part of our previous plugin
fetching mechanism and was not removed when migrating to cordova-fetch.

Fixes apache#795
raphinesse added a commit that referenced this issue Nov 22, 2019
AFAICT, the check that is removed here was part of our previous plugin
fetching mechanism and was not removed when migrating to cordova-fetch.

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

Successfully merging a pull request may close this issue.

2 participants