soldair / node-qrcode

qr code generator
MIT License
7.54k stars 630 forks source link

ReferenceError:“TextEncoder”未定义 #373

Open wjyzhixing opened 2 months ago

wjyzhixing commented 2 months ago

Hello!My node version is v16.20.0.

I installed version 1.5.4 of qrcode, and I encountered an error on IE11. The error message is as follows:"

1724416648537

How can I deal with this problem?Or is this a bug?It will appreciate that if you can give me some advice.

M393 commented 2 months ago

TextEncoder usage was added with #317 v1.5.4, so either use 1.5.3 or add a polyfill for TextEncoder like https://github.com/anonyco/FastestSmallestTextEncoderDecoder

wjyzhixing commented 2 months ago

yes,now I use v1.5.3 version.But if I use v1.5.4.If I alse use fastestsmallesttextencoderdecoder-encodeinto.I can only resolve the import of TextEncoder in my code.How to deal with the code in node_modules lib?my npm run build is base in babel.Here is my babel.config.js image How can I do more to fix in v1.5.4?I realy want to learn this method to solve it.Thank you very much.