lindell / lindell/JsBarcode

JsBarCode not working - Encoder type missing

Open
#206 2 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.