JsBarcode icon indicating copy to clipboard operation
JsBarcode copied to clipboard

JsBarCode not working - Encoder type missing

Open kitzler-walli opened this issue 6 years ago • 2 comments

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.

kitzler-walli avatar Dec 05 '17 15:12 kitzler-walli

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.

chrp avatar Dec 19 '18 22:12 chrp

检查您正在使用的条形码标准。我在设置jsbarcode-format="ean"。更改它以jsbarcode-format="ean13"使代码找到有效的编码器。 那里设置啊不是很明白???

lcwebgroup avatar Jan 29 '19 12:01 lcwebgroup