Home > Back-end >  Ionic 6 Capacitor, electron: Cordova is not available. Make sure to include cordova.js or run in a d
Ionic 6 Capacitor, electron: Cordova is not available. Make sure to include cordova.js or run in a d

Time:02-24

I am trying to use the cordova plugin in a new ionic 6 project but I always run into errors regarding cordova. The plugin is properly installed and shows up in the plugin folder. I use Ionic 6 vue, capacitors and capacitor-community/electron to build windows native App. everything ok but get this error on run cordova plugin in simulator:

Native: tried calling Printer.print, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

npm i @capacitor-community/electron
npx cap add @capacitor-community/electron
ionic build
ionic build @capacitor-community/electron && npx cap copy @capacitor-community/electron
npx cap open @capacitor-community/electron

CodePudding user response:

Capacitor doesn't support Cordova plugins on web nor electron, they are only supported on iOS and Android.

CodePudding user response:

There is an open issue for Capacitor on GitHub:

https://github.com/ionic-team/capacitor/issues/769

Unfortunately, Cordova plugin support is currently only available on Android and iOS.

  • Related