fix(deps): extend pnpm.onlyBuiltDependencies for pnpm@11 compatibility#703
fix(deps): extend pnpm.onlyBuiltDependencies for pnpm@11 compatibility#703adm-jdlc wants to merge 1 commit into
Conversation
pnpm 11 blocks native build scripts by default unless the package is listed in pnpm.onlyBuiltDependencies. The current allowlist only contains better-sqlite3 and node-pty, but the lockfile has 5 more packages with material install/postinstall logic: - @parcel/watcher (native compile) - @swc/core (platform binary fetch) - esbuild (platform binary fetch) - sharp (platform binary fetch) - unrs-resolver (NAPI native) Without these, fresh `bash install.sh --docker` runs against pnpm@latest hit ERR_PNPM_IGNORED_BUILDS, better-sqlite3 silently fails to compile, and the Dockerfile's postinstall verify step exits non-zero. vue-demi also appears in the warning but is intentionally omitted: its postinstall is a no-op try/catch shim with no side effects. Verified locally: `bash install.sh --docker` completes cleanly with pnpm 11.1.3 after this change. Fixes builderz-labs#702
|
Update — found a more nuanced root cause while testing locally. After landing this fix in my workspace, I ran So as of pnpm 11+, Two takeaways:
Notably, when pnpm 11+ runs Happy to amend this PR to add |
Fixes #702.
Summary
Extends
pnpm.onlyBuiltDependenciesinpackage.jsonfrom 2 to 7 entries so fresh Docker installs work cleanly against pnpm 11.The current allowlist (
better-sqlite3,node-pty) was correct for pnpm 10's permissive default but is incomplete now that pnpm 11 blocks unlisted native build scripts. Five additional packages in the lockfile legitimately need their install/postinstall to run:@parcel/watchernode scripts/build-from-source.js@swc/corenode postinstall.jsesbuildnode install.jssharpunrs-resolvernapi-postinstall ... checkvue-demiappears in the warning but is intentionally omitted — its postinstall is a no-op try/catch shim with no side effects, so allowlisting it would add noise.Test plan
bash install.sh --dockerfrom a fresh checkout against pnpm 11.1.3 — completes with noERR_PNPM_IGNORED_BUILDSwarnings.GET /api/status?action=healthreturns{"status":"healthy"}./setupflow + admin creation work end-to-end.pnpm install(host-side, without Docker) also clean.Notes
corepack prepare pnpm@11 --activate) so the next major bump doesn't silently break installs again.