apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it. #1224

Closed GhoshWorld closed 2 years ago

GhoshWorld commented 2 years ago

Bug Report


Failed to restore plugin "cordova-plugin-request-location-accuracy". You might need to try adding it again. Error: CordovaError: Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

Failed to restore plugin "cordova-plugin-camera". You might need to try adding it again. Error: CordovaError: Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

Failed to restore plugin "cordova-plugin-network-information". You might need to try adding it again. Error: CordovaError: Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

Failed to restore plugin "cordova-sms-plugin". You might need to try adding it again. Error: CordovaError: Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

Problem

Using "requireCordovaModule" to load non-cordova module "glob" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

Version information



   Ionic CLI                     : 5.4.16 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 5.6.6
   @angular-devkit/build-angular : 0.1102.18
   @angular-devkit/schematics    : 11.2.11
   @angular/cli                  : 11.2.11
   @ionic/angular-toolkit        : 3.1.1

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v12.18.1 (/usr/local/bin/node)
   npm    : 6.14.5
   OS     : macOS Big Sur
   Xcode  : Xcode 12.5 Build version 12E262```

## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->

- [ ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [ ] I included all the necessary information above
breautek commented 2 years ago

This is an error for the plugin's maintainers part.

This means the plugin is using requireCordovaModule to import dependencies that cordova has declared, when it should declare/install the dependencies itself and use the normal require() api to import the dependency. This has been enforced as of Cordova CLI 9.x if I recall correctly.

I'd suggest ensuring that your plugins are up-to-date. (Use cordova plugin remove <pluginName> / cordova plugin add <pluginName>@latest). If the issue persists, you may need to report the issue to the plugin's maintainer, or fork the plugin to address the issue yourself. https://github.com/apache/cordova-lib/issues/689 can be referenced for context.

Closing as not-a-bug.