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

Can't resolve 'cordova-plugin-file-transfer' #358

Closed
marcelloinfoweb opened this issue Jan 7, 2023 · 1 comment
Closed

Can't resolve 'cordova-plugin-file-transfer' #358

marcelloinfoweb opened this issue Jan 7, 2023 · 1 comment

Comments

@marcelloinfoweb
Copy link

Install command: npm install https://github.com/apache/cordova-plugin-file-transfer

Command: vue-cli-service serve
image

@breautek
Copy link
Contributor

breautek commented Jan 9, 2023

Cordova plugins aren't really an NPM module so to speak. They are distributed through NPM, but they cannot be required or resolved as a typical NPM module. Cordova has it's own module system in which Cordova will embed the plugin's JS into your application when Cordova is loaded, clobbering the global namespace as defined in their plugin.xml file. It is an antiquated system, an artefact that existed before NPM even existed.

So to work around your issue, remove the cordova-plugin-file-transfer import in your code. Depending on your framework/build system, you may also need to prefix the API call with window. or configure it to accept additional global variables.

As long as the deviceready event has fired, any cordova plugin APIs should be available and ready to be used.

Closing as not a bug.

@breautek breautek closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
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