fix(deploy): use pnpm 11 allowBuilds key; drop dead package.json pnpm field

pnpm 11 ignores both package.json's pnpm.onlyBuiltDependencies and the
pnpm-workspace.yaml onlyBuiltDependencies key — it reads the build allow-list
from `allowBuilds` (as written by `pnpm approve-builds`). Switch to that so
`pnpm install` compiles better-sqlite3/esbuild/sharp automatically on deploy,
and remove the now-ignored package.json field that emitted a warning.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arlind 2026-06-17 15:07:39 +02:00
parent cf534777af
commit 9d0326e3ea
2 changed files with 9 additions and 12 deletions

View file

@ -34,8 +34,5 @@
},
"engines": {
"node": ">=22"
},
"pnpm": {
"onlyBuiltDependencies": ["better-sqlite3", "esbuild", "sharp"]
}
}

View file

@ -1,9 +1,9 @@
# pnpm 10+ moved several settings out of package.json's "pnpm" field into
# this file. `onlyBuiltDependencies` allow-lists packages permitted to run
# install/build scripts (pnpm now blocks build scripts by default). Without
# this, better-sqlite3's native binary is never compiled and the server
# crashes at runtime with ERR_DLOPEN_FAILED / NODE_MODULE_VERSION mismatch.
onlyBuiltDependencies:
- better-sqlite3
- esbuild
- sharp
# pnpm 10+ stopped reading build-script settings from package.json's "pnpm"
# field and blocks dependency build scripts by default. pnpm 11 reads the
# allow-list from `allowBuilds` here (captured via `pnpm approve-builds`).
# Without it, better-sqlite3's native binary is never compiled and the SSR
# server crashes at runtime (ERR_DLOPEN_FAILED / NODE_MODULE_VERSION mismatch).
allowBuilds:
better-sqlite3: true
esbuild: true
sharp: true