zxing-js / ngx-scanner

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

Type 'ElementRef' is not generic #367

Closed wolnavi closed 1 year ago

wolnavi commented 3 years ago

Bug, feature request, or proposal:

Error

What is the expected behavior?

I am able to run this scanner in Ionic 3

What is the current behavior?

There is an error preventing me: image

Typescript Error
Type 'ElementRef' is not generic.
../node_modules/@zxing/ngx-scanner/lib/zxing-scanner.component.d.ts
previewElemRef: ElementRef<HTMLVideoElement>;

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://stackblitz.com/fork/zxing-ngx-scanner

  1. Follow the steps in Getting Started
  2. Run command in cmd ionic serve
  3. You will be presented with this error

What is the use-case or motivation for changing an existing behavior?

Nil

Which versions of Angular, ngx-scanner, OS, TypeScript, browsers are affected?

    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "3.14.0",
    "@ionic-native/splash-screen": "4.20.0",
    "@ionic-native/status-bar": "4.20.0",
    "@ionic/storage": "2.2.0",
    "@zxing/browser": "0.0.5",
    "@zxing/library": "^0.18.3",
    "@zxing/ngx-scanner": "3.0.0",
    "ionic-angular": "3.9.9",
    "ionicons": "3.0.0",
    "rxjs": "6.0.0",
    "rxjs-compat": "6.2.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.29"
    "@ionic/app-scripts": "3.2.4",
    "typescript": "3.1.1"

Is there anything else we should know?

odahcam commented 3 years ago

You are probably using the wrong version of this component with Ionic or Angular.