You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a comment as below that skips monkey patching when an electron method is in the callstack but no reasoning behind this decision. /* Skip monkey patching when an electron method is in the callstack. */
Can you explain why you skip patching in this case as it means sqlite3 cannot be used within Electron with asar enabled and sqlite3 unpacked.
Error I am seeing: { Error: Cannot find module 'C:\Users\FlyingSquad\AppData\Local\EMRConnect\app-1.4.0\resources\app.asar\node_modules\sqlite3\lib\binding\electron-v1.4-win32-ia32\node_sqlite3.node' at Module._resolveFilename (module.js:455:15) at Function.Module._resolveFilename (C:\Users\FlyingSquad\AppData\Local\EMRConnect\app-1.4.0\resources\electron.asar\common\reset-search-paths.js:35:12) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object.<anonymous> (C:\Users\FlyingSquad\AppData\Local\EMRConnect\app-1.4.0\resources\app.asar\node_modules\sqlite3\lib\sqlite3.js:6:15) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) code: 'MODULE_NOT_FOUND' }
The text was updated successfully, but these errors were encountered:
IIRC, it skips in the case where the caller is in ELECTRON_ASAR or electron.asar because child_process.spawn/exec is already aware of asar.unpack dir. Patching here breaks the node spawner.
node_sqlite3.node is a binary, not a node module. It doesn't make sense.
child_process API must be used here. I don't understand.. or maybe it's just because require('node-pre-gyp').find is already doing strange things with require().
But even in this case, it should work. I think that the problem is around the lines 310 and 313 of node-pre-gyp. https://github.com/mapbox/node-pre-gyp/blob/master/lib/util/versioning.js#L310
According to the comments, it's using relative paths (and with hazardous it's a problem). I must investigate step by step by debugging this stuff.
There is a comment as below that skips monkey patching when an electron method is in the callstack but no reasoning behind this decision.
/* Skip monkey patching when an electron method is in the callstack. */
Can you explain why you skip patching in this case as it means sqlite3 cannot be used within Electron with asar enabled and sqlite3 unpacked.
Error I am seeing:
{ Error: Cannot find module 'C:\Users\FlyingSquad\AppData\Local\EMRConnect\app-1.4.0\resources\app.asar\node_modules\sqlite3\lib\binding\electron-v1.4-win32-ia32\node_sqlite3.node' at Module._resolveFilename (module.js:455:15) at Function.Module._resolveFilename (C:\Users\FlyingSquad\AppData\Local\EMRConnect\app-1.4.0\resources\electron.asar\common\reset-search-paths.js:35:12) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object.<anonymous> (C:\Users\FlyingSquad\AppData\Local\EMRConnect\app-1.4.0\resources\app.asar\node_modules\sqlite3\lib\sqlite3.js:6:15) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) code: 'MODULE_NOT_FOUND' }
The text was updated successfully, but these errors were encountered: