lindell / lindell/JsBarcode

ITF-14 TypeError

Open
#424 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Hello,

I want to make ITF-14 barcode. Here is my code:

```
JsBarCode('#test', '9007901', {
format: 'ITF-14',
lineColor: '#0aa',
width: 4,
height: 40,
displayValue: false,
});
```

Result is javascript error:
```
Uncaught (in promise) TypeError: api.options(...)[options.format] is not a function
at JsBarcode2 (JsBarcode.js:76:38)
```

The 76th line of JsBarCode.js:
```
api.options(options)[options.format](text, options).render();
```

Contributor guide

Open the contributing guide

Research direction

Start at JsBarcode.js line 76 and inspect how options.format is resolved against registered barcode formats. Reproduce the issue with the supplied ITF-14 example and verify the expected format name or registration path. Done means the example no longer raises the reported TypeError and produces the requested barcode.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.