Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.4 PouchConstructor is not a constructor #2734

Closed
ColinFrick opened this issue Sep 5, 2014 · 7 comments
Closed

3.0.4 PouchConstructor is not a constructor #2734

ColinFrick opened this issue Sep 5, 2014 · 7 comments

Comments

@ColinFrick
Copy link

After updating to PouchDB 3.0.4 I receive following error:

PouchConstructor is not a constructor

Throwing line is 557 in replicate.js:

function toPouch(db, opts) {
  var PouchConstructor = opts.PouchConstructor;
  if (typeof db === 'string') {
    return new PouchConstructor(db);
  } else if (db.then) {
    return db;
  } else {
    return utils.Promise.resolve(db);
  }
}
@calvinmetcalf
Copy link
Member

how are you calling replicate ?

@calvinmetcalf
Copy link
Member

so we switched how PouchDB.replicate worked in 3.0.4 to now care about this if you pass it strings for dtabases so if your doing something like var replicate = PouchDB.replicate, replicate('foo', 'bar'); that will break

@ColinFrick
Copy link
Author

PouchDB.sync(this.get('dbName'), remoteCouch, {live: true})

So I have to use

db.sync(remoteCouch, {live: true});

now?

@calvinmetcalf
Copy link
Member

you can do

PouchDB.sync(new PouchDB(this.get('dbName')), remoteCouch, {live: true})

this should be fixed soon

@ColinFrick
Copy link
Author

Okay thanks

@calvinmetcalf
Copy link
Member

see #2736

@nolanlawson
Copy link
Member

assuming this is fixed by 4a90552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants