fix: rebuild better-sqlite3 for Electron's Node ABI in prod builds

Electron 41 embeds Node 24 (ABI 145) while system Node 22 (ABI 127)
produces incompatible native modules. Add electron-rebuild step to the
desktop build pipeline so better-sqlite3 is recompiled against
Electron's headers before packaging.
This commit is contained in:
Mohamed Boudra
2026-04-11 18:33:49 +07:00
parent 28f45a41a5
commit 149a415016
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -36350,6 +36350,7 @@
"ws": "^8.14.2"
},
"devDependencies": {
"@electron/rebuild": "^4.0.3",
"@types/node": "24.6.0",
"@types/ws": "^8.5.14",
"electron": "41.0.3",
+3 -1
View File
@@ -5,9 +5,10 @@
"description": "Paseo desktop app (Electron wrapper)",
"main": "dist/main.js",
"scripts": {
"build": "npm --prefix ../.. run build:daemon && npm run build:main && electron-builder --config electron-builder.yml",
"build": "npm --prefix ../.. run build:daemon && npm run build:main && npm run rebuild-native && electron-builder --config electron-builder.yml",
"build:main": "tsc -p tsconfig.json",
"dev": "./scripts/dev.sh",
"rebuild-native": "electron-rebuild -m ../.. -o better-sqlite3",
"test": "vitest run",
"typecheck": "tsc --noEmit -p tsconfig.json"
},
@@ -19,6 +20,7 @@
"ws": "^8.14.2"
},
"devDependencies": {
"@electron/rebuild": "^4.0.3",
"@types/node": "24.6.0",
"@types/ws": "^8.5.14",
"electron": "41.0.3",