Skip to content

Build your personal knowledge base with Trilium Notes

fix(desktop): check the v13 prebuild path in the ARM64 better-sqlite3 guard

Elian Doran9cbb0ed3fbb3
diff --git a/apps/desktop/electron-forge/forge.config.ts b/apps/desktop/electron-forge/forge.config.ts
index 08e071b826..ed58f50c35 100644
--- a/apps/desktop/electron-forge/forge.config.ts
+++ b/apps/desktop/electron-forge/forge.config.ts
@@ -269,9 +269,13 @@ const config: ForgeConfig = {
}
// Check that the bettersqlite3 binary has the right architecture.
+ // Since v13, better-sqlite3 ships N-API prebuilds and the Electron
+ // native rebuild was dropped, so no build/Release/ addon is ever
+ // produced. The loadable binary is the shipped prebuild, which
+ // auto-unpack-natives extracts to app.asar.unpacked/.../prebuilds/.
if (packageResult.platform === "linux" && packageResult.arch === "arm64") {
for (const outputPath of packageResult.outputPaths) {
- const binaryPath = join(outputPath, "resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node");
+ const binaryPath = join(outputPath, "resources/app.asar.unpacked/node_modules/better-sqlite3/prebuilds/linux-arm64.node");
if (!existsSync(binaryPath)) {
throw new Error(`[better-sqlite3] Unable to find .node file at ${binaryPath}`);
}