Tried using these imports
import PouchDB from 'pouchdb';
import PouchDBAuth from 'pouchdb-authentication';
PouchDB.plugin(PouchDBAuth)
Module ''pouchdb-authentication'' has no default export is the error generated while using these imports.
PouchDB.plugin(require('pouchdb-authentication'));
Using require is removing the error but still showing db.login() is not a function.Can anyone suggest where the issue is?
Well I found why it was not working in my situation, I was using this :
import '*' as PouchDBAuthentication from 'pouchdb-authentication';
instead of
import PouchDBAuthentication from 'pouchdb-authentication';
So the right way is
import PouchDBAuthentication from 'pouchdb-authentication';
import PouchDB from 'pouchdb';
PouchDB.plugin(PouchDBAuthentication);
In the second hand the following steps should be done : https://github.com/pouchdb-community/pouchdb-authentication/issues/211
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With