Closed Qsaws closed 2 years ago
Also get this warning for Angular 10:
'qrcode' is not a known element:
1. If 'qrcode' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.ng
Can't bind to 'qrdata' since it isn't a known property of 'qrcode'.ng
As stated in the link in the error code.
add the line below to your angular.json
"allowedCommonJsDependencies": [ "qrcode" ]
I'm getting this issue with both Angular 10 AND 11:
`Error: src/app/jobs/jobs-swing-tag/jobs-swing-tag.component.html:5:13 - error NG8002: Can't bind to 'qrdata' since it isn't a known property of 'qrcode'.
5 <qrcode [qrdata]="'A simple string'" [size]="256" [level]="'M'">
`
I've added the allowedCommonJsDependencies line above and still the same error.
I have created a standalone version but wondered if there's an easy way to determine why this error is occurring without having to compare different projects line by line.... you know, like a debug or verbose switch somewhere?
(the ng serve --verbose command gives me TOO MUCH information to decypher... -_- )
TIA
We get these warnings on build after an upgrade to Angular10.
WARNING in ../node_modules/angularx-qrcode/fesm2015/angularx-qrcode.js depends on 'qrcode'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Any chance for this to be fixed?
Can we have a fix for this, so we do not have to add it into allowedCommonJsDependencies?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
So no fix in sight?
No, this won't be fixed for version <= 10 as there is an easy workaround available.
Please open a new issue with a minimal working app so I may reproduce the issue. Thank you!
The proposed fix here is a "sweep problem under the rug" work around. The underlying problem is that angularx-qrcode
uses qrcode
which itself does not support ESM import-mode, and won't do so anytime soon because the core maintainer is not interested in doing it themselves (see corresponding ticket).
I commented on the underlying issue here #110 in more detail a while ago
We get these warnings on build after an upgrade to Angular10.
Any chance for this to be fixed?