edi9999 / jsqrcode

[deprecated] Lazarsoft's jsqrcode as a node module, object oriented, and with tests
Apache License 2.0
278 stars 63 forks source link

How to run on ServerSide. #42

Closed nsisodiya closed 7 years ago

nsisodiya commented 7 years ago

How I can run this on the server side. I want to decode a QR Code. and I am getting following error.

/Users/narendrasisodiya/Coding/Billexo/trupay-upi-node-sdk/node_modules/qrcode-reader/dist/index.js:3050
    var image = new Image();
                    ^

ReferenceError: Image is not defined
    at QrCode.decode (/Users/narendrasisodiya/Coding/Billexo/trupay-upi-node-sdk/node_modules/qrcode-reader/dist/index.js:3050:21)
    at qrImageToTransactionId (/Users/narendrasisodiya/Coding/Billexo/trupay-upi-node-sdk/src/qrImageToTransactionId.js:9:13)
    at Object.<anonymous> (/Users/narendrasisodiya/Coding/Billexo/trupay-upi-node-sdk/src/qrImageToTransactionId.js:14:13)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
edi9999 commented 7 years ago

have a look at the tests, they are running in node https://github.com/edi9999/jsqrcode/blob/master/test/qrcode.js