pouchdb / pouchdb-server

CouchDB-compatible server built on PouchDB and Node
Apache License 2.0
952 stars 154 forks source link

express-pouchdb db.infos() is not a function #359

Open dezmou opened 5 years ago

dezmou commented 5 years ago

In this commit : https://github.com/pouchdb/pouchdb-server/commit/4d22dd4ef7dc3909db355cf10e8d1bc43df1f87d

The file lib/routes/db.js those line is added

var db = req.PouchDB.new(name, utils.makeOpts(req));
db.info(function (err, db) {

I don't know if it is because a new version of pouchDB but, the db variable is actualy a promise so db.info() throw an unhandledPromiseRejection here in a simple project where I try to sync to my database with a client.

itsjimbo commented 5 years ago

I think 4.1.0 is broken -

yarn add express-pouchdb
cat node_modules/express-pouchdb/package.json 
----
    "pouchdb-collections": "^6.4.1",
    "pouchdb-find": "^6.4.1",
    "pouchdb-list": "4.1.0",
    "pouchdb-promise": "^6.4.1",
    "pouchdb-replicator": "4.1.0",
    "pouchdb-rewrite": "4.1.0",
    "pouchdb-security": "4.1.0",
---

pouchdb-find should be at 7.0.0

TypeError: db.request is not a function  
at find (/node_modules/express-pouchdb/node_modules/pouchdb-find/lib/index.js:52:6)
at PouchDB.<anonymous> (/node_modules/express-pouchdb/node_modules/pouchdb-find/lib/index.js:1373:3