JsBarcode
JsBarcode copied to clipboard
JsBarCode not working - Encoder type missing
Everytime I try to run the JSBarcode code I get the following error in chrome:
Uncaught TypeError: Encoder is not a constructor at encode (JsBarcode.all.js:1322) at JsBarcode.all.js:1393 at ErrorHandler.wrapBarcodeCall (JsBarcode.all.js:1015) at API.init (JsBarcode.all.js:1390)
The line errors refer to this file: https://cdn.jsdelivr.net/npm/[email protected]/dist/JsBarcode.all.js
Tried Version 3.8 and 3.6 - both fail.
I'm using the way of injecting svg elements in my code and call JsBarcode(".barcode").init(); afterwards.
Check the barcode standard you're using. I was setting jsbarcode-format="ean"
. Changing it to jsbarcode-format="ean13"
made the code to find a working encoder.
检查您正在使用的条形码标准。我在设置
jsbarcode-format="ean"
。更改它以jsbarcode-format="ean13"
使代码找到有效的编码器。 那里设置啊不是很明白???