Reputation: 51
levelup.js?006c:115Uncaught TypeError: dbFactory is not a function
This is my question. I use it in chrome, but it's ok. When I use it in electron (Vue2.0), the same, but give me this tip. Who can help me?
Upvotes: 3
Views: 183
Reputation: 46
Try to use init PouchDB as
const PouchDB = require('electron').remote.require('pouchdb');
Upvotes: 0
Reputation: 699
I faced the same issue and couldn't resolve it. Here's some documentation: https://github.com/nolanlawson/hello-electron-with-pouchdb. The author says that an alternate solution is to use the browser version of pouchdb, which ultimately worked for me.
Example:
import PouchDB from 'pouchdb-browser'
const db = new PouchDB('testdb', {adapter: 'websql'});
Docs: https://pouchdb.com/adapters.html
Upvotes: 1