reactive-qr
reactive-qr copied to clipboard
Import errors
Similar to #3 I am getting
./node_modules/reactive-qr/dist/index.js Attempted import error: './qr_decode.worker' does not contain a default export (imported as 'QRWorker')
When running a minimal example. I am using HTTPS.
Seconded, it's not clear at all how #3 could be suddenly working for anyone.
I haven't had much time to play with it, but the issues I see are:
- A named ES6 import of "./qr_decode.worker" will not work (potentially without some other interpreting happening for magical compatibility in your workflow, Babel?)
- Along those lines, defining
new QRWorker()
also should not work without magical compatibility processing.
I haven't had much time to test, but it seems the following changes to index.js
solve the problem:
Remove:
import QRWorker from './qr_decode.worker';
Change:
this.webWorker = new QRWorker();
to:
this.webWorker = new Worker('qr_decode.worker.js');
If I have time, I'll throw together a very small PR for this, but please don't wait up for it.
Installed the package from npm and I'm having the exact same issue.
I'm having the same issues. Running react 16.8.4