'capacitorExports is not defined' error during bundling and runtime
See original GitHub issueDescribe 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.<anonymous> (/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:
- Install barcode-scanner Capacitor plugin
- Import and use it somewhere
- 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
Issue Analytics
- State:
- Created 10 months ago
- Comments:5
Top Results From Across the Web
'capacitorExports is not defined' error during bundling #12
Our project's web assets (webpack) build is failing if the following import { BleClient } from '@capacitor-community/bluetooth-le'; defined ...
Read more >capacitorExports is not defined" while running jest tests in a ...
I got this horrible "ReferenceError: capacitorExports is not defined" error while running the tests in my Ionic/Angular/Capacitor project ...
Read more >Typescript ReferenceError: exports is not defined
On a node.js server? You will need a module loader in the run-time environment that the javascript finally runs in. From the compiler...
Read more >"gsap|Cubic .... is not defined" when bundling modules
i using bundler parcel my dir src | -- js |-- a.js |-- b.js import { gsap } from "gsap"; or import "gsap";...
Read more >barcode-scanner - githubmemory
Not All QR are Readable. mobiliseapplabllp ... Barcode Scanner not open. aziziaziz ... 'capacitorExports is not defined' error during bundling and runtime.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great! Thanks a lot for your help and your feedback!
Working perfectly now, much appreciated!