DOMException: setPhotoOptions failed when stoping scanner after upgrade from v17.0.1 to 17.0.2 or above
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.1but 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",
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?
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
plz test 18.0.1
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.
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
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.