-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Upgrading to Angular 14 throws error #498
Comments
EDIT: See that 3.8.0 has Angular 15 support, so downgraded to 3.6.2, but same result |
Getting Same issue for me, I'm using below versions for my application Error: node_modules/@zxing/ngx-scanner/lib/zxing-scanner.component.d.ts:305:18 - error TS2707: Generic type 'ɵɵComponentDeclaration' requires between 7 and 8 type arguments. "@zxing/browser": "^0.1.1", Angular CLI 14.2.10 |
Tested on a fresh angular app version 14.2.0 {
"name": "test",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^14.2.0",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/forms": "^14.2.0",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@zxing/browser": "^0.1.1",
"@zxing/library": "^0.19.1",
"@zxing/ngx-scanner": "^3.6.2",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.2.6",
"@angular/cli": "~14.2.6",
"@angular/compiler-cli": "^14.2.0",
"@types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
} |
I'm facing the same issue, it works on a fresh installation but doesn't work in the application I am currently developing |
The way it worked for me was to remove the references to |
This has fixed the issue. Thanks |
I still have same error with:
|
Change line to static ɵcmp: i0.ɵɵComponentDeclaration<ZXingScannerComponent, "zxing-scanner", never, { "autofocusEnabled": "autofocusEnabled"; "timeBetweenScans": "timeBetweenScans"; "delayBetweenScanSuccess": "delayBetweenScanSuccess"; "autostart": "autostart"; "previewFitMode": "previewFitMode"; "device": "device"; "formats": "formats"; "videoConstraints": "videoConstraints"; "torch": "torch"; "enable": "enable"; "tryHarder": "tryHarder"; }, { "autostarted": "autostarted"; "autostarting": "autostarting"; "torchCompatible": "torchCompatible"; "scanSuccess": "scanSuccess"; "scanFailure": "scanFailure"; "scanError": "scanError"; "scanComplete": "scanComplete"; "camerasFound": "camerasFound"; "camerasNotFound": "camerasNotFound"; "permissionResponse": "permissionResponse"; "hasDevices": "hasDevices"; "deviceChange": "deviceChange"; }, never, never, false>; and it works... The error is right there, too many arguments in type definition |
@gjsmith66 but how can this workaround work in a CI/CD environment? |
I was facing the same issue, it seems like the library should increase the major version when upgrading angular versions, but it doesn't.
The latest version supporting angular 14 is exactly 3.6.2, so we need to remove the caret from the version and it should work fine: |
For me, downgrading to 3.9.0 worked with angular 15. The latest 3.9.1 was producing the error above. |
Nice! It's indeed a little bit confusing when the patch version has a breaking change |
It is.. I'm sorry for that. I'll create minor updates for different angular versions in the future. I thought that the versions would support multiple angular versions at the same time that's why only the patch level was updated! |
Thank you ! Maybe it's possible to create a mapping table in the Readme to highlight angular version compatibility. Other angular wrappers like ngx-bootstrap do it like that. |
It is okay, I've seen many good libraries starting without updating the major versions and then changing the versioning system through the years. Thank you for worrying about it =) Also, I like @marxxxx's suggestion, it might be nice to have the compatibility table highlighted in the README for newcomers, with a description that says to fix the version at the package.json. EDIT: I've added a version compatibility table into the wiki Getting started page |
Thanks, @leonardodimarchi I'll copy that to the readme and also release a 16.0 that is similar to 3.9.1 |
@werthdavid Not sure it's such a good idea to follow Angular versions. What if you need to introduce a breaking change before Angular releases a new version? Following semver is good practice, but there's no need to tie it to the Angular release cycle, just keep a compatability refrence up to date. |
It worked for me too with Angular 15! |
Describe the bug
After upgrading to Anglular 14,
npm start
throws this error:To Reproduce
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: