ngx-qrcode: Error message still referencing ngx-qrcode2
This might be related to #10.
I’m getting the following error message when ng serve:
ERROR in ../src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve 'ngx-qrcode2' in 'D:\path_to_project\src\app'
As suggested in a comment from 2017 in that issue, using ngx-qrcode2 directly, works.
Versions:
- Angular CLI: 8.3.20
- Node: 13.11.0
- OS: Windows 10
- Angular: 8.2.14
- @techiediaries/ngx-qrcode: ^9.0.0
Usage (just adding the relevant lines):
- package.json
"dependencies": {
"@techiediaries/ngx-qrcode": "^9.0.0"
}
- app.module.ts
import { NgxQRCodeModule } from '@techiediaries/ngx-qrcode';
@NgModule({
imports: [
NgxQRCodeModule,
]
})
- home.component.ts
export class HomeComponent implements OnInit {
elementType = 'url';
exampleLink = '';
constructor(private toastr: ToastrService,private authService: AuthService) { }
ngOnInit() {
this.exampleLink = 'http://localhost:4200/example/qrc?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dnZWRJbkFzIjoiYWRtaW4iLCJpYXQiOjE0MjI3Nzk2Mzh9.gzSraSYS8EXBxLN_oWnFSRgCzcmJmMjLiuyu5CSpyHI';
}
}
- home.component.html
<ngx-qrcode [elementType]="elementType" [value]="exampleLink"></ngx-qrcode>
Thanks
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15
@bergamin we are working to solve this problem ASAP.
Closed by #63
As the original issue, it’s solved we close this issue. To solve the Angular 6 compatibility open a new issue, please.
@rafa-as, it worked for me. Waiting for next issues on my project to try it out on a real environment
@anakin59490 I don’t test the new version with Angular 6 yet. But I’m sure that doesn’t work as @bergamin said because the version is not compatible.
Please, can you open a new issue to check the compatibility and create documentation about this?
@bergamin you can check in the readme the solution about your issue: https://github.com/techiediaries/ngx-qrcode#troubleshoots
@anakin59490, there you go:
package.json
I’m on Angular 8. That could be the issue…
Also, I had a problem when trying the lib out that I don’t quite remember what it was about. Not sure if your case, but I solved it by adding this to
index.html:With previous version (9.0.0), I had same error as @bergamin : Error: Can’t resolve ‘ngx-qrcode2’
I have just changed version : 9.1.0 and now I have this mesage (cf picture)
@rafa-as thanks for updating us on this issue
@anakin59490, no. Except for adding the dependency directly the way I mentioned (which is deprecated), I have not.
They say they are working on a similar problem right now (see #10 last comments), but I expected they would at least have commented something here by now