lindell / lindell/JsBarcode

more than 1 call to JsBarcode errors api.options(...)[options.format] is not a function

Open
#400 1 comment 0 reactions 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

```
var upc=new Image()
new JsBarcode(
upc,
"796030114977",
{
format: "UPC",
width: 3,
height: 80,
}
)
var cno=new Image()
new JsBarcode(
cno,
"796030114977",
{
format: "UPC",
width: 3,
height: 80,
}
)
```

on the second call i get
```
runtime-core.esm-bundler.js?5c40:218 Uncaught TypeError: api.options(...)[options.format] is not a function
at JsBarcode (JsBarcode.js?62c5:76)
...
```

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

Start at JsBarcode.js around line 76 and reproduce the two consecutive JsBarcode calls shown in the issue. Trace why the second call reaches the reported options.format error, then verify that the same two-call example completes without the exception.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.