AGBrown/pouchdb.d.ts

Module '"@types/pouchdb/index"' has no default export.

Opened this issue · 6 comments

I want to use pouchdb. It worked in my ionic3 version of the app, but when switching to v4, i get this problem.
From a blank app, I install pouchdb and its types :

npm install --save pouchdb
npm install --save @types/pouchdb

But then, if in home.ts I try (it worked before)

import PouchDB from 'pouchdb';

I get this error :

Module '"@types/pouchdb/index"' has no default export.

I tried the same from a blank v3 app, the issue is the same. I think there is something broken in the typings ?
Or do I miss something ?

This project is kinda deprecated, as the work done here was migrated back to DefinitelyTyped and then further improved/reworked by other contributors to be up-to-date with PouchDB and typescript patterns.
You should use the "main" type deinitions now, directly from npm/DefinitelyTyped:

@AGBrown , we should update the README to reflect that.

Well, if you're now using the one from npm@types which comes from DefinitelyTyped, then I suggest you recreate this issue there, so that many more typescript experts can help. Unfortunately I can't help you with that error.

@trollanfer how did you solve this? have the same problem .. :(

oh found a solution. Whoever has a problem in ionic 4 try to add

"allowSyntheticDefaultImports": true
in your tsconfig then you can import pouchdb using t

import PouchDB from 'pouchdb';