Skip to content

typeError PouchPromise.reject is not a function #69

Description

@zagglez

with react.js on node.js stack

"npm": "6.14.15",

"node": "14.18.1"
"promise": "^8.1.0",
"pouchdb": "^7.2.2",
"pouchdb-find": "^7.2.2",
"pouchdb-upsert": "^2.2.0",
"react": "^17.0.2",

Bug in pouchdb-upsert/index.js
This seems to be analogous to a promise.resolve bug others have spotted with similar fix:

function upsertInner(db, docId, diffFun) {
if (typeof docId !== 'string') {
return PouchPromise.reject(new Error('doc id is required'));
}

fails to transpile with typeError PouchPromise.reject is not a function.

This following fix seems to allow the code to transpile correctly:
//node_modules/pouchdb-upsert/index.js - line 4
//var PouchPromise = require('pouchdb-promise');
//to
//var PouchPromise = require('pouchdb-promise').default;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions