Closed Yanis02015 closed 1 year ago
I think sqlite has its own .node
module, right? If so, that likely means your packaging rules (maybe extraFiles
?) for including it in your packaged application. That would also explain why it works in a dev environment, since the file resolution still points at local hard disk versus a packaged application where the path is completely different.
Not sure how electron-forge
is automatically packaging it as I'm not familiar with that packager.
I don't really understand the role of asar:true
but when I give it the value false it works, but on the other hand in two clicks I have access to the project file from the .dmg file.
My configuration file: electron-builder.json5
/**
* @see https://www.electron.build/configuration/configuration
*/
{
appId: "YourAppID",
productName: "YourAppName",
copyright: "Copyright © 2022 ${author}",
asar: false,
directories: {
output: "release/${version}",
buildResources: "electron/resources",
},
files: ["dist-electron", "dist"],
win: {
target: [
{
target: "nsis",
arch: ["x64"],
},
],
artifactName: "${productName}-Windows-${version}-Setup.${ext}",
},
nsis: {
oneClick: false,
perMachine: false,
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false,
},
mac: {
target: ["dmg"],
artifactName: "${productName}-Mac-${version}-Installer.${ext}",
},
linux: {
icon: "electron/resources/iconset",
target: ["AppImage", "deb"],
artifactName: "${productName}-Linux-${version}.${ext}",
},
}
Would you be willing to create a reproducible example repro of this using electron-quick-start
? That'll help me significantly and I can then test it locally, my best guess currently is the extraFiles
isn't including .node
module.
Re: asar: false
, it means that the app is not packaged in the standard app.asar
file, so all files are copied over as-is incl. directory structure. For .node
files, it should auto-unpack them to app.asar.unpacked
but not sure if that currently is occurring. An electron-quick-start
repro repo would significantly help
I'm using vitejs and react and sequelize with sqlite3 to make my electron application work
When I'm in the dev environment, everything works fine. When I build with electron-forge the application works very well.
But when I build with electron-builder it builds my app but when I try to open the app I have this error
My package.json
the sequelize configuration