neocotic / qrious

Pure JavaScript library for QR code generation using canvas
https://neocotic.com/qrious
Other
1.55k stars 215 forks source link

TypeError: Cannot set property 'QRious' of undefined #128

Open clawfire opened 3 years ago

clawfire commented 3 years ago

Line 22 (global.QRious = factory()); got me the error TypeError: Cannot set property 'QRious' of undefined

My code was a simple

var qrcode = new QRious({
    element: canvas,
    value: "plop",
    size: 300,
    level: "M"
});
ROBERT-MCDOWELL commented 3 years ago

is you canvas variable exist?

clawfire commented 3 years ago

yep

ROBERT-MCDOWELL commented 3 years ago

did you import Qrious class after the html element? replace also canvas by img element