From 34dd3c707cd3bdc7a4b4357aef1ed63751567174 Mon Sep 17 00:00:00 2001 From: Sergio Date: Sat, 7 Mar 2026 11:23:07 -0800 Subject: [PATCH] fix(scanner): prefer ZXing WASM BarcodeDetector for Data Matrix reliability --- assets/js/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/app.js b/assets/js/app.js index 4dd39581..ed0648c0 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -48,6 +48,7 @@ global.$ = global.jQuery = require("jquery"); //Use the local WASM file for the ZXing library import { + BarcodeDetector as ZXingBarcodeDetector, setZXingModuleOverrides, } from "barcode-detector/ponyfill"; import wasmFile from "../../node_modules/zxing-wasm/dist/reader/zxing_reader.wasm"; @@ -59,3 +60,7 @@ setZXingModuleOverrides({ return prefix + path; }, }); + +// Prefer the ZXing WASM detector over inconsistent native BarcodeDetector implementations. +// This improves Data Matrix decoding reliability for difficult DigiKey labels (see #1281). +globalThis.BarcodeDetector = ZXingBarcodeDetector;