question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'capacitorExports is not defined' error during bundling and runtime

See original GitHub issue

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.<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:

  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

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
thegnuucommented, Nov 24, 2022

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

0reactions
AAmanzicommented, Nov 24, 2022

Working perfectly now, much appreciated!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found