'Ionic 6 Capacitor, electron: Cordova is not available. Make sure to include cordova.js or run in a device/simulator
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
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Victor |
