quaggaJS icon indicating copy to clipboard operation
quaggaJS copied to clipboard

../node_modules/quagga/lib/quagga.js' does not provide an export named 'default'

Open Thkasis opened this issue 5 years ago • 3 comments

Hey, I am adding

import quagga from 'quagga';

and get the error in the title. I haven't added anything else. Testing it on Chrome

and if I try import * as Quagga from 'quagga';

I get typeError: Cannot read property 'get-pixels' of undefined at webpackUniversalModuleDefinition

Am I missing anything ? Thank you

Thkasis avatar Aug 20 '19 15:08 Thkasis

that's an interesting result -- are you attempting to do this without using webpack or anything like that, just importing it via native javascript import? i have tried that exactly zero times on any code anywhere, so i'm not real sure how it works, if so. :-D

ericblade avatar Aug 20 '19 20:08 ericblade

Hmm ... yes. So I need to use webpack? I'm trying to import it in a web component. Thanks for the comment.

Thkasis avatar Aug 22 '19 17:08 Thkasis

That, I don't know. The app I'm building uses babel and webpack, as does pretty much every project i've ever seen that is using more advanced things like import.. so.. i don't really have any idea why that would fail.. :-S

ericblade avatar Aug 22 '19 20:08 ericblade