zxing-js / browser

ZXing for JS's browser layer with decoding implementations for browser.
MIT License
223 stars 44 forks source link

Error: [InvalidAccessError] Track has ended at applyConstraints ([native code]::) #131

Open Preefix opened 8 months ago

Preefix commented 8 months ago

When the camera is unmounted the following error occurs on the latest iOS Version 17.4:

This is tested with

"@zxing/browser": "0.1.4", and "@zxing/browser": "0.1.3". Everything worked as expected on iOS 16.

Error: [InvalidAccessError] Track has ended at applyConstraints ([native code]::) at generator (webpack://app/nodemodules/@zxing/browser/esm/readers/BrowserCodeReader.js:120:72) at .ops.pop (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:43:27) at step (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:18:70) at Promise ([native code]::) at new (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:14:26) at __generator (webpack://app/nodemodules/@zxing/browser/esm/readers/BrowserCodeReader.js:776:107) at .ops.pop (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:43:27) at step (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:18:70) at Promise ([native code]::) at new (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:14:26) at generator (webpack://app/nodemodules/@zxing/browser/esm/readers/BrowserCodeReader.js:789:65) at .ops.pop (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:43:27) at step (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:18:70) at Promise ([native code]::) at new (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:14:26) at scannerControls.current?.stop (webpack://app/src/components/common/XzingBarCodeScanner.tsx:57:39) at loop (webpack://app/node_modules/@zxing/browser/esm/readers/BrowserCodeReader.js:1123:27)

Steps to reproduce the behavior:

Initialize the camera Unmount the camera (after scanning, or what ever else) See error The error should not appear. It happens only on the latest iOS Version. Version 16 works fine.

Smartphone (please complete the following information):

Device: every iPhone with Version 17 OS: iOS17.4 Browser Safari + Chrome Version latest