zxing-js / ngx-scanner

Angular QR code, Barcode, DataMatrix, scanner component using ZXing.
https://zxing-js.github.io/ngx-scanner/
MIT License
644 stars 228 forks source link

ngx-scanner v.3.6.2 is not compatible with Angular 13 #489

Open rvalitov opened 2 years ago

rvalitov commented 2 years ago

I could update ngx-scanner via npm from version 3.4.2 to 3.6.2. But when I try to build the project I get an error, that the module requires Angular 14 only:

./node_modules/@zxing/ngx-scanner/fesm2015/zxing-ngx-scanner.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: Cannot create property 'message' on string 'C:\git\TicketingApp-pwa\src\pwa\node_modules\@zxing\ngx-scanner\fesm2015\zxing-ngx-scanner.mjs: This application depends upon a library published using Angular version 14.0.2, which requires Angular version 14.0.0 or newer to work correctly.
Consider upgrading your application to use a more recent version of Angular.

Testing dependencies tree:

> npm view ngx-scanner dependencies
{ tslib: '^1.9.0' }

image

To use ngx-scanner Angular 13 in dependencies use version 3.5.0:

"@zxing/ngx-scanner": "3.5.x"
rvalitov commented 2 years ago

I wanted to make a PR, but I see nothing wrong with the project.json. Could it be that the module did not upload properly to npm?

zlq4863947 commented 2 years ago

I have the same problem too, please fix it asap

spock123 commented 2 years ago

I works fine for me, I am using Angular 14.2.1

Can build, deploy and run the scanner without issues.

0pahh commented 2 years ago

Mine is working perfectly fine on the latest version of angular.

Got no issues at all

rvalitov commented 2 years ago

I'm talking about Angular 13. Not 14!

spock123 commented 2 years ago

@rvalitov I understand, but I assumed it would be helpful for others than you to know that it seems to be working with newer versions.

Can I ask why you don't just upgrade Angular to v14?