Dan
Dan

Reputation: 2174

ionic: not able to do prod build appRate ionic4

I am getting below error, why and how to fix this? : ERROR in src\app\app.module.ts(27,15): Error during template compile of 'AppModule' enter image description here

in Vscode its shows like enter image description here

Basically, I am trying to add a rating feature in my ionic app. First, I followed this ionic AppRate tutorial

$ ionic cordova plugin add cordova-plugin-apprate
$ npm install --save @ionic-native/app-rate@beta

and in app.modules.ts file i added below code:

import { AppRate } from '@ionic-native/app-rate';
...
...
providers: [  ...
   AppRate, ...  //i added this in this file 
  ],
    ...
    ...

Ionic info enter image description here

Upvotes: 0

Views: 138

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53301

For @ionic-native/whatever@beta you have to import the ngx folder instead of the base folder. So for AppRate it should be:

import { AppRate } from '@ionic-native/app-rate/ngx';

See that you already did that on the NativeStorage and the commented Network plugin imports.

Upvotes: 2

Related Questions