Matias Salimbene
2018-10-19 00:38:33 UTC
Hello,
I'm using pouchDB as a cdb for an app and I'm struggling to understand this
error: *Uncaught TypeError: PouchDB is not a constructor*
The declaration is as follows:
var PouchDB = require("pouchdb");var db = new PouchDB("scr");
I've read about how it may be related to types and that adding:
"@types/node": "^10.12.0",
"@types/pouchdb": "^6.3.2",
to my package.json should help, but it isn't. I've tested on another simple
.js file and works, but on my main app it isn't. Still, I don't understand
why it wouldn't work. The pouch documentation is quite clear
https://pouchdb.com/api.html#create_document. I should mention I'm running
this on the context of an electron app, not in the browser.
Any tip is greatly appreciated,
Cheers, Matias.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/ba0ec025-ed76-491c-8e25-559051d07c3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm using pouchDB as a cdb for an app and I'm struggling to understand this
error: *Uncaught TypeError: PouchDB is not a constructor*
The declaration is as follows:
var PouchDB = require("pouchdb");var db = new PouchDB("scr");
I've read about how it may be related to types and that adding:
"@types/node": "^10.12.0",
"@types/pouchdb": "^6.3.2",
to my package.json should help, but it isn't. I've tested on another simple
.js file and works, but on my main app it isn't. Still, I don't understand
why it wouldn't work. The pouch documentation is quite clear
https://pouchdb.com/api.html#create_document. I should mention I'm running
this on the context of an electron app, not in the browser.
Any tip is greatly appreciated,
Cheers, Matias.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/ba0ec025-ed76-491c-8e25-559051d07c3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.