ngx-scanner icon indicating copy to clipboard operation
ngx-scanner copied to clipboard

DOMException: setPhotoOptions failed when stoping scanner after upgrade from v17.0.1 to 17.0.2 or above

Open anbaran opened this issue 1 year ago • 6 comments

I have recently upgraded @zxing/ngx-scanner from v17.0.1 to 17.0.2 (or above the same error occurs as well) and as soon as the scanner is stopped by either calling scanStop() or enabled = false or removing component from DOM then the error DOMException: setPhotoOptions failed appears in the console.

I noticed the following things:

  • it does not occur in v17.0.1 but in versions above
  • it does not occur in browser but on devices both Android & iOS (cordova hybrid app i.e. webapp packed for device)
  • it seams like the difference between browser and device is torch , in browser not available , on device available
  • dependent zxing libraries are in versions: "@zxing/browser": "0.1.5", "@zxing/library": "0.21.1",

anbaran avatar Jun 21 '24 15:06 anbaran

Hm the only thing that happened from 17.0.1 to 17.0.2 is #557 which should do a proper cleanup... can you post the whole stacktrace?

werthdavid avatar Jul 02 '24 20:07 werthdavid

Hm the only thing that happened from 17.0.1 to 17.0.2 is #557 which should do a proper cleanup... can you post the whole stacktrace?

Hello David

Thank you for looking into this issue. Below I paste you the console output from the device and the obfuscated part of your code from the suspected area. It is hard to read the stacktrace because it is obfuscated code but I hope it will give you an idea of what going on under the hood is. If you need any more information, let me know

image

Screenshot from 2024-07-03 09-43-04

anbaran avatar Jul 03 '24 07:07 anbaran

plz test 18.0.1

werthdavid avatar Jul 11 '24 18:07 werthdavid

plz test 18.0.1

Hello, Thanks for reacting to that. I have just tried it out but unfortunately I still get the error when stopping scanner, below the log file.

setPhotoOptionsFailed.log

anbaran avatar Jul 12 '24 06:07 anbaran

Hello, I have the same error when I dynamically change the value of the [(device)] attribute. It crashes on my cell phone (Android 14) with Chrome. Everything's OK when I use my laptop with integrated and external webcams or an iPhone 13 (iOS 18, Chrome or Safari). Thanks

Mallette avatar Oct 28 '24 18:10 Mallette

I have this problem too, even though I'm using version 20.0.0. My error message is:

UnknownError: setPhotoOptions failed

This problem occurs when I leave the page and go to another page.

mostafa1374 avatar Oct 18 '25 14:10 mostafa1374