Hi there. I am a rookie when it comes to Cordova plugins because I’ve always been able to use Capacitor plugins. However, I am trying to get this bluetooth plugin to work in my project. I read the docs, I ran the following commands:
npm install https://github.com/flemmingdjensen/cordova-plugin-ble-central.git
npx cap update
Things appear to be working because I see:
✔ Copying web assets from dist to android/app/src/main/assets/public in 79.00ms
✔ Copying native bridge in 2.42ms
✔ Copying capacitor.config.json in 1.10ms
Found 1 Cordova plugin for android
cordova-plugin-ble-central (1.3.1)
✔ copy in 179.88ms
✔ Copying web assets from dist to ios/App/public in 73.50ms
✔ Copying native bridge in 709.66μp
✔ Copying capacitor.config.json in 2.66ms
⠙ copy Found 1 Cordova plugin for ios
cordova-plugin-ble-central (1.3.1)
But I am unable to import the plugin into the project. I am probably doing it wrong!
import 'cordova-plugin-ble-central/web/ble.js';
When I try to compile, I get:
ERROR Failed to compile with 1 error 11:39:38 PM
This dependency was not found:
* cordova-plugin-ble-central in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Home.vue?vue&type=script&lang=js
What am I doing wrong? I am thinking I’m doing a few things wrong! Any help would be great!