npm / barcode-detector
barcode-detector
What changed in barcode-detector 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-24.
4 breaking2 deprecations6 new APIs and options1 performance1 behavior and defaults5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initbarcode-detector 319 changes
Breaking changes 4
Detection results now distinguish DataBar and Code 39 sub-variants; code matching exact format values may need to account for the more specific names.
BarcodeDetector is no longer a subclass of EventTarget, so it no longer provides the event-target behavior previously used for customized event handling.
EAN-2/5 add-on symbols are now ignored, aligning behavior with native barcode detectors in Chromium and Safari on macOS.
With the zxing-wasm v2 dependency, prepareZXingModule replaces setZXingModuleOverrides; consult zxing-wasm's README for instructions on the new APIs.
Deprecations 2
The subpath export previously named side-effects is now named polyfill; the old export is deprecated and no longer recommended.
The subpath export previously named pure is now named ponyfill; the old export is deprecated and no longer recommended.
New APIs and options 6
Adds micro_pdf417 as a supported barcode format.
Adds telepen as a supported barcode format.
Adds telepen_alpha as a supported barcode format.
Adds telepen_numeric as a supported barcode format.
The formats option accepts additional format names, including sub-variants and input hints that may filter detection to the appropriate symbology family.
The formats option accepts three shorthand meta formats for selecting GS1-compatible, retail, or industrial barcode formats.
Performance 1
Detection latency decreased by approximately 40–48% in benchmarked 720p/1080p scenarios on Chromium 156 (Apple M3 Pro).
Behavior and default changes 1
Upstream detector improvements may shift some barcodes’ cornerPoints by 1–2 px; rawValue is unchanged.
Fixes and other changes 5
Internally created ImageBitmap resources are released after Blob conversion, including when conversion fails.
Upstream detector crash fixes are included.
When WASM initialization fails, only a service unavailable DOM exception is thrown instead of unhandled errors.
Subpath export types are now compatible with TypeScript's moduleResolution: node strategy.
A zero-sized Blob image no longer throws an error, in keeping with the spec for zero-sized ImageBitmapSource inputs.