techiediaries / ngx-qrcode

An Angular 9/10 Component Library for Generating QR (Quick Response) Codes
https://techiediaries.com/ngx-qrcode/
MIT License
192 stars 62 forks source link

Error message still referencing ngx-qrcode2 #57

Closed bergamin closed 4 years ago

bergamin commented 4 years ago

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:

Usage (just adding the relevant lines):

@NgModule({ imports: [ NgxQRCodeModule, ] })


- home.component.ts
```typescript
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';
  }
}

Thanks

anakin59490 commented 4 years ago

Hi, Have you found solution ?

bergamin commented 4 years ago

@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

rafa-suagu commented 4 years ago

@bergamin we are working to solve this problem ASAP.

bergamin commented 4 years ago

@rafa-as thanks for updating us on this issue

rafa-suagu commented 4 years ago

@bergamin we just published a new 9.1.0 version. Can you check it?

anakin59490 commented 4 years ago

Hi @rafa-as ,

here is my result: image

rafa-suagu commented 4 years ago

@anakin59490 can you provide more information about your environment and error in another issue, please?

Your error doesn't have anything common with the original issue.

anakin59490 commented 4 years ago

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-suagu commented 4 years ago

Sorry @anakin59490 I don't saw your previous reply.

Did you removed the node_modules folder and reinstall it? If not, can you try it? What environment you have? Angular8, or 9?

anakin59490 commented 4 years ago

I removed the node_modules and reinstalled it but i get the same error.

I use Angular 6

bergamin commented 4 years ago

@rafa-as, it worked for me. Waiting for next issues on my project to try it out on a real environment

anakin59490 commented 4 years ago

@bergamin can you post your package.json please ? It's may be version conflict..

bergamin commented 4 years ago

@anakin59490, there you go:

package.json ```json { "name": "xxxxxx", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "~8.2.4", "@angular/cdk": "^8.2.3", "@angular/common": "~8.2.4", "@angular/compiler": "~8.2.4", "@angular/core": "~8.2.4", "@angular/forms": "~8.2.4", "@angular/material": "^8.2.3", "@angular/platform-browser": "~8.2.4", "@angular/platform-browser-dynamic": "~8.2.4", "@angular/router": "~8.2.4", "@ngrx/effects": "^8.5.2", "@ngrx/store": "^8.5.1", "@ngrx/store-devtools": "^9.0.0", "@zxing/ngx-scanner": "^3.0.0", "date-fns": "^2.7.0", "ngx-cookie-service": "^3.0.4", "@techiediaries/ngx-qrcode": "^9.1.0", "ngx-toastr": "^11.3.0", "rxjs": "~6.4.0", "tslib": "^1.10.0", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "~0.803.3", "@angular/cli": "~8.3.3", "@angular/compiler-cli": "~8.2.4", "@angular/language-service": "~8.2.4", "@types/node": "~8.9.4", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", "codelyzer": "^5.0.0", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.1.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.15.0", "typescript": "~3.5.3" } } ```

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:

  <script>
    if (global === undefined) {
      var global = window;
    }
  </script>
rafa-suagu commented 4 years ago

@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

rafa-suagu commented 4 years ago

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.