Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anbaran opened this issue Jun 21, 2024 · 5 comments
Labels

Comments

@anbaran
Copy link

anbaran commented Jun 21, 2024

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 anbaran added the bug label Jun 21, 2024
@werthdavid
Copy link
Member

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?

@anbaran
Copy link
Author

anbaran commented Jul 3, 2024

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

werthdavid added a commit that referenced this issue Jul 11, 2024
werthdavid added a commit that referenced this issue Jul 11, 2024
@werthdavid
Copy link
Member

plz test 18.0.1

@anbaran
Copy link
Author

anbaran commented Jul 12, 2024

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

@Mallette
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants