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

Updating to angular 11 make it stop working on some devices

Open jakubpeksa opened this issue 4 years ago • 18 comments

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

jakubpeksa avatar Feb 12 '21 19:02 jakubpeksa

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.

pfeigl avatar Feb 15 '21 17:02 pfeigl

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.

pfeigl avatar Feb 15 '21 20:02 pfeigl

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?

odahcam avatar Feb 25 '21 21:02 odahcam

image This gave me the impression, that the disable of ivy is actually missing in 3.1.3

pfeigl avatar Feb 25 '21 23:02 pfeigl

same error on angular 11.1.2 image

payamss avatar Feb 28 '21 11:02 payamss

up

jakubpeksa avatar Mar 06 '21 22:03 jakubpeksa

@AurelienLoyer

C0ZEN avatar Mar 19 '21 13:03 C0ZEN

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

mrazvanalex avatar Apr 12 '21 16:04 mrazvanalex

same Problem here with Angular 11: zxing scanner component: TypeError TypeError: Cannot read property 'stop' of undefined

fabiolooo avatar Apr 18 '21 19:04 fabiolooo

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>

JoshuvaGeorge03 avatar Apr 22 '21 10:04 JoshuvaGeorge03

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",

obikanubi avatar Apr 27 '21 06:04 obikanubi

i create a pull request to update to Angular 11. #398

Jonbeckas avatar Apr 29 '21 06:04 Jonbeckas

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.

pwqw avatar Jun 30 '21 16:06 pwqw

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

lookMyCode avatar Aug 19 '21 12:08 lookMyCode

Not for me with Angular 12.0.1 and
"@zxing/browser": "^0.0.9", "@zxing/library": "^0.18.6",

mazero avatar Aug 19 '21 13:08 mazero

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:

  1. Deleted forder node_modules
  2. In file package.json in dependencies 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

image

lookMyCode avatar Aug 20 '21 07:08 lookMyCode

what about angular 13.0.3

payamss avatar Nov 26 '21 05:11 payamss

image It solved it for Angular 13 as well.

AreyXo avatar Feb 02 '22 06:02 AreyXo