louischatriot / nedb

The JavaScript Database, for Node.js, nw.js, electron and the browser
MIT License
13.46k stars 1.03k forks source link

nedb ENOENT error after packaging Electron/React App #655

Closed MayaShenHongyu closed 3 years ago

MayaShenHongyu commented 3 years ago
Screen Shot 2020-10-13 at 9 49 31 PM

In index.js:

exports.formConfig = new Datastore({
    filename: path.join(__dirname, "./db/form_config.db"),
    autoload: true,
});

In renderer process:

const db = window.require("electron").remote.require("./electron").formConfig;

It's similar but not the same as #620 Does anyone know how to solve this? Thanks a lot!!!