ngx-scanner
ngx-scanner copied to clipboard
Updating to angular 11 make it stop working on some devices
After updating to angular 11 with newest 3.13 ngx-scanner it stopped working, it detects devices (4 cameras) but video tag is not displaying anything.
That's happening on newest chrome on samsung s20, any chance I could get a working example with angular 11? Those demos are on 10 and 7
Having the same problem. Does not work on Angular 11. Demos (stackblitz) do work, but those are on Angular 7.
Also tried the native zxing-js library without the angular wrapper and that seems to work. So it really seems to be a problem with ngx-scanner.
Was just about fixing the problem but it actually worked in the sample application.
I think the reason for this is, that in the current master, ivy is disabled. This is the corresponding commit: https://github.com/zxing-js/ngx-scanner/commit/71e397e69e24f1dff63b4af50862a0cfcf900dd8
So I guess, (while updating angular to 11.2 would also be nice) - what is actually needed is only a push of the latest version to npm, because 3.1.3 was just but the ivy change.
What you mean? The latest version already is on NPM. Angular libraries cannot be published with Ivy enabled anymore. Are you saying that for version 11 Ivy should be enabled?
This gave me the impression, that the disable of ivy is actually missing in
3.1.3
same error on angular 11.1.2
up
@AurelienLoyer
The problem is that Angular 11 is now using Typescript 4 only. The whole codebase needs an update to Typescript 4 and Dependencies bumped to Angular 11.x
same Problem here with Angular 11:
zxing scanner component: TypeError TypeError: Cannot read property 'stop' of undefined
I have encountered below problem.
TypeError: Cannot read property 'stop' of undefined at zxing-ngx-scanner.js:56 at loop (BrowserCodeReader.js:1108) at BrowserMultiFormatContinuousReader.push.1M1C.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-evergreen.js:364) at Object.onInvoke (core.js:28553) at ZoneDelegate.invoke (zone-evergreen.js:363)
My project info:
` "@angular/animations": "^11.2.10", "@angular/common": "^11.2.10", "@angular/core": "^11.2.10", "@angular/fire": "^6.1.4", "@angular/forms": "^11.2.10", "@angular/platform-browser": "^11.2.10", "@angular/platform-browser-dynamic": "^11.2.10", "@angular/platform-server": "^11.2.10", "@angular/router": "^11.2.10", "@zxing/browser": "0.0.9", "@zxing/library": "^0.18.5", "@zxing/ngx-scanner": "^3.0.1",
`
My code in component:
<zxing-scanner [autostart]="true" [device]="selectedDevice" [enable]="true" (scanError)="error($event)" (scanFailure)="failure($event)" (scanSuccess)="success($event)" (camerasFound)="camerasFound($event)" (camerasNotFound)="camerasNotFound($event)" (permissionResponse)="permissionHandler($event)" [previewFitMode]="'cover'" [timeBetweenScans]="1000" [tryHarder]="false"></zxing-scanner>
got it to work with angular 11 by installing:
"@zxing/browser": "0.0.5", "@zxing/library": "^0.18.3" "@zxing/ngx-scanner": "^3.1.3",
i create a pull request to update to Angular 11. #398
Angular 11 support is a necessity.
got it to work with angular 11 by installing:
"@zxing/browser": "0.0.5", "@zxing/library": "^0.18.3" "@zxing/ngx-scanner": "^3.1.3",
wont work for me.
got it to work with angular 11 by installing:
"@zxing/browser": "0.0.5", "@zxing/library": "^0.18.3" "@zxing/ngx-scanner": "^3.1.3",
It work, thank you! Angular 12
Not for me with Angular 12.0.1 and
"@zxing/browser": "^0.0.9",
"@zxing/library": "^0.18.6",
Not for me with Angular 12.0.1 and "@zxing/browser": "^0.0.9", "@zxing/library": "^0.18.6",
Not for me with Angular 12.0.1 and "@zxing/browser": "^0.0.9", "@zxing/library": "^0.18.6",
I made this steps:
- Deleted forder
node_modules
- In file
package.json
independencies
replaced versions:
-
"@zxing/browser": "0.0.5",
-
"@zxing/library": "^0.18.3",
-
"@zxing/ngx-scanner": "^3.1.3",
You have another versions.
It was test in Angular versions: 9.1.4 and 12.0.5
what about angular 13.0.3
It solved it for Angular 13 as well.