capacitor-community / barcode-scanner

A fast and efficient (QR) barcode scanner for Capacitor
MIT License
437 stars 172 forks source link

'capacitorExports is not defined' error during bundling and runtime #174

Closed AAmanzi closed 1 year ago

AAmanzi commented 1 year ago

Describe the bug next build fails if the BarcodeScanner plugin is referenced anywhere in the project. The issue does not occur if the plugin is just imported.

The error is the following:

ReferenceError: capacitorExports is not defined at Object. (/Users/alnick/Documents/misc/bitcoin-store-frontend/node_modules/@capacitor-community/barcode-scanner/dist/plugin.js:122:8)

To Reproduce Steps to reproduce the behavior:

  1. Install barcode-scanner Capacitor plugin
  2. Import and use it somewhere
  3. See error

Expected behavior Build passes without error

Versions barcode-scanner: v3.0.0 capacitor/app: v4.1.0 capacitor/core: v4.4.0 next: v12.2.5

Additional context This looks very similar to this issue on bluetooth-le Capacitor plugin https://github.com/capacitor-community/bluetooth-le/issues/12

thegnuu commented 1 year ago

Yes, it looks like our friends at https://github.com/capacitor-community/bluetooth-le already found a solution for this issue. I will create a branch with this fix and let you know so you can test it out!

AAmanzi commented 1 year ago

Thank you very much ❤️

thegnuu commented 1 year ago

I just released v3.0.1 with the changes done in https://github.com/capacitor-community/bluetooth-le, can you please test this on your side?

AAmanzi commented 1 year ago

Working perfectly now, much appreciated!

thegnuu commented 1 year ago

Great! Thanks a lot for your help and your feedback!