Uncaught "undefined" is not a valid input for e in line JsBarcode.ean-upc.min.js:2:34333
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm using the JsBarcode library to show a barcode image and despite the fact that it's working fine, I'm getting an error in the console quite strange that I can not find out what's happening.
First of all, I'm loading the library from the cdn:
``
Then, I'm generating the barcode as follows:
**TPL/HTML file:**
```
```
Where key is being replaced by "ean13" and the reference is being replaced by the ean13 number in integer format.
**JS CODE:**
```
$(document).ready(function(){
setTimeout( function()
{
JsBarcode(".barcode").init();
}, 500);
});
```
The svg is loading well, but I'm getting the following error in the console:
```
Uncaught "undefined" is not a valid input for e [JsBarcode.ean-upc.min.js:2:34333](https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/dist/barcodes/JsBarcode.ean-upc.min.js)
value https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/dist/barcodes/JsBarcode.ean-upc.min.js:2
value https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/dist/barcodes/JsBarcode.ean-upc.min.js:2
init https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/dist/barcodes/JsBarcode.ean-upc.min.js:2
```
I have read the documentation several times and everything seems to be okay. Can you help me?
Thank you in advance.
Contributor guide
Research direction
Reproduce the console error with the TPL/HTML SVG snippet and the provided JavaScript initialization code. Start by inspecting the ean-upc.min.js stack trace and compare the generated jsbarcode-format and jsbarcode-value attributes with the ean13 example. Done means the barcode still renders without the reported undefined-input error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100