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

Cannot read properties of undefined (reading 'stop')

Open Hanzofm opened this issue 4 years ago • 7 comments

Bug, feature request, or proposal:

What is the current behavior?

Following the https://github.com/zxing-js/ngx-scanner/wiki/Getting-Started doc

When put the <zxing-scanner></zxing-scanner>

-The browser request permissions -The webcam light on macbook pro starts -Black screen appears on browser

Then the inspector console returns:

zxing-ngx-scanner.js:486 zxing scanner component: TypeError TypeError: Cannot read properties of undefined (reading 'stop')
    at zxing-ngx-scanner.js:56
    at loop (BrowserCodeReader.js:1108)
    at BrowserMultiFormatContinuousReader.BrowserCodeReader.scan (BrowserCodeReader.js:1125)
    at BrowserMultiFormatContinuousReader.<anonymous> (BrowserCodeReader.js:705)
    at step (BrowserCodeReader.js:43)
    at Object.next (BrowserCodeReader.js:24)
    at fulfilled (BrowserCodeReader.js:15)
    at ZoneDelegate.invoke (zone.js:372)
    at Object.onInvoke (core.js:28672)
    at ZoneDelegate.invoke (zone.js:371)

Which versions of Angular, ngx-scanner, OS, TypeScript, browsers are affected?

Mac OSX Big Sur
Safari browser

@zxing/[email protected]
@zxing/[email protected]
@zxing/[email protected]

"@angular/common": "12.2.1",
"@angular/compiler": "12.2.1",
"@angular/core": "12.2.1",
"@angular/forms": "12.2.1",
"@angular/platform-browser": "12.2.1",
"@angular/platform-browser-dynamic": "12.2.1",

Hanzofm avatar Sep 23 '21 11:09 Hanzofm

I have the same issue

perotom avatar Sep 30 '21 11:09 perotom

I Have the same issue. On firefox gets a screenshot then blocks. On chrome just black screen

Stefanobosio avatar Oct 05 '21 09:10 Stefanobosio

I had the same issue on Mac OSX Big Sur on Chrome, changing "@zxing/library" from "^0.18.3" to "^0.18.6" worked for me

"@zxing/browser": "^0.0.9",
"@zxing/library": "^0.18.6",
"@zxing/ngx-scanner": "^3.2.0"

marikamoku avatar Oct 07 '21 13:10 marikamoku

Thank you, updating @zxing/library solved the issue.

rvalitov avatar Oct 09 '21 03:10 rvalitov

I confirm that updating the library solved the issue mee too.

The documentation must be updated.

Stefanobosio avatar Oct 09 '21 09:10 Stefanobosio

I updated the docs.

rvalitov avatar Oct 13 '21 12:10 rvalitov

zxing scanner component: TypeError TypeError: Cannot read property 'stop' of undefined Having this issue on windows for angular 14 "@zxing/ngx-scanner": "3.6.2" "@zxing/browser": "^0.1.1", "@zxing/library": "^0.19.1"

Praveen-VTS avatar Sep 13 '23 13:09 Praveen-VTS