【问题标题】:PouchDB in an Electron app gives error "dbFactory is not a function"Electron 应用程序中的 PouchDB 给出错误“dbFactory 不是函数”
【发布时间】:2017-07-06 08:26:44
【问题描述】:

levelup.js?006c:115Uncaught TypeError: dbFactory is not a function

这是我的问题。 我在chrome中使用它,但没关系。 当我在电子(Vue2.0)中使用它时,相同,但给我这个提示。 谁能帮帮我?

【问题讨论】:

  • 这里也一样... =(

标签: pouchdb


【解决方案1】:

我遇到了同样的问题,但无法解决。这是一些文档:https://github.com/nolanlawson/hello-electron-with-pouchdb。作者说另一种解决方案是使用浏览器版本的 pouchdb,它最终对我有用。

例子:

import PouchDB from 'pouchdb-browser'

const db = new PouchDB('testdb', {adapter: 'websql'});

文档:https://pouchdb.com/adapters.html

【讨论】:

    【解决方案2】:

    尝试使用init PouchDB as

    const PouchDB = require('electron').remote.require('pouchdb');
    

    【讨论】:

      猜你喜欢
      • 2018-03-11
      • 1970-01-01
      • 2016-06-11
      • 1970-01-01
      • 2019-01-06
      • 2021-06-17
      • 1970-01-01
      • 1970-01-01
      • 2018-12-16
      相关资源
      最近更新 更多