zxpsuper / qrcode-with-logos

A plugin for generating QR codes with a logo and styling.
https://zxpsuper.github.io/qrcode-with-logos
MIT License
137 stars 41 forks source link

global is not defined #10

Closed almaz1213 closed 10 months ago

almaz1213 commented 3 years ago

the line

var QRCode = require("qrcode");

in your module causes "global is not defined".

package.json in my case:

...
"dependencies": {
    "@angular/common": "~9.0.4",
    "@angular/core": "~9.0.4",
...
declare var global: any;

in my component doesn't help

zxpsuper commented 3 years ago

the line

var QRCode = require("qrcode");

in your module causes "global is not defined".

package.json in my case:

...
"dependencies": {
    "@angular/common": "~9.0.4",
    "@angular/core": "~9.0.4",
...
declare var global: any;

in my component doesn't help

There are something wrong in "qrcode" dependencies. I will delete it in the future. You can try to use esm format. For example

import QrCodeWithLogo from 'qrcode-with-logos'
almaz1213 commented 3 years ago
var QRCode = require("qrcode");

inside yor module not in my code. so you should use esm format. but i use other other module now