Question: Barcode Not Being Displayed On Item Page

Barcode Not Being Displayed On Item Page

I have added an item to the system and set the code and symbology but it doesn't show up. Instead there is a js console error: ``` runtime-core.esm-bundler.js:226 TypeError: t is not a cons

JW

J W

Asked

I have added an item to the system and set the code and symbology but it doesn’t show up. Instead there is a js console error:

runtime-core.esm-bundler.js:226 TypeError: t is not a constructor
    at y (JsBarcode.js:117)
    at JsBarcode.js:188
    at e.value (ErrorHandler.js:40)
    at h.init (JsBarcode.js:185)
    at Proxy.mounted (Details.vue:190)
    at Lt (runtime-core.esm-bundler.js:155)
    at It (runtime-core.esm-bundler.js:164)
    at Array.t.__weh.t.__weh (runtime-core.esm-bundler.js:2913)
    at ao (runtime-core.esm-bundler.js:358)
    at lo (runtime-core.esm-bundler.js:394)
(anonymous) @ runtime-core.esm-bundler.js:226
Ft @ runtime-core.esm-bundler.js:204
Lt @ runtime-core.esm-bundler.js:158
It @ runtime-core.esm-bundler.js:164
t.__weh.t.__weh @ runtime-core.esm-bundler.js:2913
ao @ runtime-core.esm-bundler.js:358
lo @ runtime-core.esm-bundler.js:394
Promise.then (async)
oo @ runtime-core.esm-bundler.js:287
to @ runtime-core.esm-bundler.js:281
(anonymous) @ reactivity.esm-bundler.js:183
ve @ reactivity.esm-bundler.js:189
(anonymous) @ reactivity.esm-bundler.js:300
set @ runtime-core.esm-bundler.js:6888
(anonymous) @ Index.vue:463
Promise.then (async)
goto @ Index.vue:462
onClick @ Index.vue:89
Lt @ runtime-core.esm-bundler.js:155
It @ runtime-core.esm-bundler.js:164
o @ runtime-dom.esm-bundler.js:349
  • MS

    Mian Saleem

    Answered

    Hello,

    I will need to check this, please let me know the install url with login details.

    Thank you

  • JW

    J W

    Answered

    Fixed, there is a bug in the code. The symbology formats written to the database for the barcodes are wrong. Instead of “ean-13” etc, it should be “EAN13” which is what the barcode.js script requires.

    In resources/js/Pages/Item/Form.vue change:

    FROM:

    symbologies: [
            { value: 'code128', label: this.$t('CODE128') },
            { value: 'code39', label: this.$t('CODE39') },
            { value: 'ean-5', label: this.$t('EAN-5') },
            { value: 'ean-8', label: this.$t('EAN-8') },
            { value: 'ean-13', label: this.$t('EAN-13') },
            { value: 'upc', label: this.$t('UPC-A') },
          ]
    

    TO:

    symbologies: [
            { value: 'CODE128', label: this.$t('CODE128') },
            { value: 'CODE39', label: this.$t('CODE39') },
            { value: 'EAN5', label: this.$t('EAN-5') },
            { value: 'EAN8', label: this.$t('EAN-8') },
            { value: 'EAN13', label: this.$t('EAN-13') },
            { value: 'UPC', label: this.$t('UPC-A') },
          ]
    
  • MS

    Mian Saleem

    Answered

    Hello, Thank you very much for correcting me. I will update this in next update.

  • Login to Reply