JsBarCode not working - Encoder type missing
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
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/jsbarcode@3.8.0/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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Chrome error with the jsbarcode@3.8.0 dist/JsBarcode.all.js bundle and the SVG injection call shown in the issue. Inspect encode and API.init around the reported lines to determine why Encoder is not constructible. Done means the documented SVG initialization works without the TypeError; no test file is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100