Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import errors #5

Open
mcallistertyler opened this issue Jul 8, 2019 · 3 comments
Open

Import errors #5

mcallistertyler opened this issue Jul 8, 2019 · 3 comments

Comments

@mcallistertyler
Copy link

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.

@joshgentry
Copy link
Contributor

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.

@jorgeserras
Copy link

Installed the package from npm and I'm having the exact same issue.

@mm420admin
Copy link

I'm having the same issues. Running react 16.8.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants