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

typeError PouchPromise.reject is not a function #69

Open
zagglez opened this issue Dec 1, 2021 · 0 comments
Open

typeError PouchPromise.reject is not a function #69

zagglez opened this issue Dec 1, 2021 · 0 comments

Comments

@zagglez
Copy link

zagglez commented Dec 1, 2021

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;

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

1 participant