Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught "undefined" is not a valid input for e in line JsBarcode.ean-upc.min.js:2:34333 #444

Open
OliverCG opened this issue Feb 1, 2024 · 0 comments

Comments

@OliverCG
Copy link

OliverCG commented Feb 1, 2024

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:

<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/dist/barcodes/JsBarcode.ean-upc.min.js"></script>

Then, I'm generating the barcode as follows:

TPL/HTML file:

<svg class="barcode"
  jsbarcode-format="{$key}"
  jsbarcode-value="{$reference|@trim|intval}"
  jsbarcode-textmargin="0"
  jsbarcode-fontoptions="bold"
  jsbarcode-width="2"
  jsbarcode-height="40">
</svg>

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant