Something is wrong with the constructor of my service component but I can't figure it out. I'm trying to inject SQLitePorter but I get the following error:
core.js:6241 ERROR Error: Uncaught (in promise): Error: This constructor is not compatible with Angular Dependency Injection because its dependency at index 3 of the parameter list is invalid.
This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
Please check that 1) the type for the parameter at index 3 is correct and 2) the correct Angular decorators are defined for this class and its ancestors.
Error: This constructor is not compatible with Angular Dependency Injection because its dependency at index 3 of the parameter list is invalid.
This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
Please check that 1) the type for the parameter at index 3 is correct and 2) the correct Angular decorators are defined for this class and its ancestors.
My Service with its constructor looks like the following.
import { BehaviorSubject } from 'rxjs';
import { Platform } from '@ionic/angular';
import { DatePipe } from '@angular/common';
import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
import { SQLitePorter } from '@ionic-native/sqlite-porter/ngx';
@Injectable({
providedIn: 'root'
})
export class DatabaseService {
constructor(private plt: Platform, private sqlite: SQLite, private datepipe: DatePipe, private sqlPorter: SQLitePorter) {
The problem is definitely with the constructor, but it is not component specific. In other components of my app I get the same error, but it is only with this cordova plugin. Other injections work fine. Help is appreciated.