nekodb icon indicating copy to clipboard operation
nekodb copied to clipboard

error compiling on electron

Open jarloyz opened this issue 6 years ago • 1 comments

i got this error when i install my electron build index.js:1 Uncaught ReferenceError: NeDBClient is not defined at Object.755b (index.js:1) at o (bootstrap:79) at Object.11f5 (ko.js:3) at o (bootstrap:79) at Module.56d7 (datastore.js:1) at o (bootstrap:79) at Object.0 (app.c8b985a0.js:1) at o (bootstrap:79) at a (bootstrap:45) at bootstrap:152

i solve it putting let NeDBClient = require('./nedb') let MongoClient = require('./mongo') on lib/clients/index.js

jarloyz avatar Nov 06 '19 19:11 jarloyz

ah could be a strict mode thing or maybe electron doesn't have a global scope or... anyway those should indeed not be global variables, essentially a typo on my part. if you want to make a PR that adds the variable declarations that'd be super cool. (I'd use const instead of let since they'll never be reassigned.)

Otherwise I'll fix it, but I figured I'd give you the chance to take the credit :stuck_out_tongue_winking_eye:

4strid avatar Nov 08 '19 11:11 4strid