QRScanner prepare gives object is not a function error

QRScanner prepare gives object is not a function error.
Getting a run time error Object(…) not a function.

Following is the code
import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { QRScanner, QRScannerStatus } from ‘@ionic-native/qr-scanner/ngx’;

 selector: 'page-home',
  templateUrl: 'home.html'
export class HomePage {

  constructor(public navCtrl: NavController,private qrScanner: QRScanner) {


startScan() {
console.log('Start Scan');

  .then((status: QRScannerStatus) => {
    if (status.authorized) {
      // camera permission was granted
    } else if (status.denied) {
      // camera permission was permanently denied
      // you must use QRScanner.openSettings() method to guide the user to the settings page
      // then they can grant the permission from there
    } else {
      // permission was denied, but not permanently. You can ask for permission again at a later time.
  .catch((e: any) => console.log('Error is', e));

// this.qrScanner.scan();
// this.qrScanner.show();

// start scanning
// let scanSub = this.qrScanner.scan().subscribe((text: string) => {
//   console.log('Scanned something', text);

//   this.qrScanner.hide(); // hide camera preview
//   scanSub.unsubscribe(); // stop scanning
// });



I get this error on browser as well as android device

I’m getting the same error. Please post the solution if you reached one.

you are on ionic 3? You use capacitor? You installed the correct versions in package.json?

Best regards, anna-liebt


same here. To less informations.

Best regards, anna-liebt

I’m getting the exact same error, I’m on @latest-3 for ionic 3 version