Struggling with integrating PouchDB into my Angular project, I've experimented with various import methods :
import PouchDB from 'pouchdb';
import * as PouchDB from 'pouchdb';
In my service, I'm utilizing it like this :
database: PouchDB.Database = new PouchDB(DATABASE_URL);
When using import PouchDB from 'pouchdb'
, the error message displayed is:
src/app/core/pouchdb/pouchdb.service.ts(3,8): error TS1192: Module '"{PATH_OF_PROJECT}/node_modules/@types/pouchdb/index"' has no default export.
And when using
import * as PouchDB from 'pouchdb'
, the error message shown is:
ERROR TypeError: PouchDB is not a constructor at new PouchDBService
Here are the versions of the packages involved :
- PouchDB : 6.4.3
- @types/pouchdb : 6.3.2
- Angular packages : 5.2.0
- @angular/cli : 1.7.4
Your assistance is greatly appreciated.