Intosoft / qrcode

The best tool for QR Code generation in JavaScript (React, React Native, Node.js, VueJS, Angular, JQuery, VanillaJS)
https://custoqr.com
MIT License
10 stars 1 forks source link

Can't get the vanilla version to work #40

Closed barriteau closed 4 months ago

barriteau commented 4 months ago

Hi, followed instructions for VanillaJS in https://www.custoqr.com/, I double-checked before posting, but it could be me anyway... I'm testing the simplest possible use case (a simple html file with nothing else but this library), and while loading console comes with two errors:

Uncaught Error: Dynamic require of "fs" is not supported
...

And as consequence:

Uncaught TypeError: can't access property "generateSVGString", window.custoqr is undefined
...

I'm testing in Google Chrome and Mozilla Firefox (both dev versions), any suggestions?

Hoping to get it working, it's a very cool tool ;) thanks in advance.

Regards

sakul-budhathoki commented 4 months ago

Hi @barriteau Thanks for using this package. Recently I have changed the package name for better SEO on npm.

It hasn't been update on Readme and https://custoqr.com. Sorry for inconvenience. I will update them today.

For now you can try this: For vanilla: https://unpkg.com/@intosoft/qrcode@0.1.0/dist/iife/index.js

window.custoqr -> window.qrcode

I will check for 'fs' issue and update you later. Thanks.

barriteau commented 4 months ago

Thanks to you for this tool and for your attention :)

Did as suggested, seems like window.qrcode is undefined comes as a consequence of throwing the error about fs; is it that window.qrcode never gets to be defined? I'm just guessing...

sakul-budhathoki commented 4 months ago

@barriteau Thanks for this. I have fixed the issue:

https://unpkg.com/@intosoft/qrcode@0.1.1/dist/iife/index.js

It will work on this version.

barriteau commented 4 months ago

Thanks to you! Worked perfectly.

I guess you set defaults for the config object, but if I leave it empty, at least the absence of config.shapes.eyeFrame throws an undefined error, not a big deal, but some future bug reports could be prevented from covering this :)

Another possible mistake: this doesn't look like a 0.1, but more like a 0.9, at least... ;)

Thank you very much!

barriteau commented 4 months ago

@barriteau Thanks for this. I have fixed the issue:

https://unpkg.com/@intosoft/qrcode@0.1.1/dist/iife/index.js

It will work on this version.

All good :)