Skip to content

fix(docker-bun): strip Node SQLite addon from runtime - #11482

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
TheDemonTuan:fix/bun-runtime-strip-native
Aug 25, 2026
Merged

fix(docker-bun): strip Node SQLite addon from runtime#11482
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
TheDemonTuan:fix/bun-runtime-strip-native

Conversation

@TheDemonTuan

Copy link
Copy Markdown
Contributor

Summary

  • stop copying the top-level better-sqlite3 package into the Bun runner
  • remove every traced or vendored better-sqlite3 copy after standalone assembly
  • fail the image build if any better_sqlite3.node binary remains
  • add a focused regression test

Root cause

An ARM64 Bun container reached bun:sqlite, then aborted during startup with NAPI FATAL ERROR: Error::New napi_get_last_error_info. Isolated probes against the exact failed image showed only better-sqlite3 reproduced the native abort; keytar, onnxruntime-node, sqlite-vec, tls-client-node, wreq-js, and sharp all imported successfully. A JavaScript try/catch cannot recover from this process-level abort.

This PR is intentionally Bun-only. It does not change Node source compatibility or unrelated deployment/Caddy automation. It complements #11468 and #11470 by ensuring no additional standalone copy can still be loaded after the Bun-native SQLite startup path is selected.

Validation

  • failing before the fix, passing after: node --test tests/unit/build/bun-runtime-native-addon.test.mjs
  • production ARM64 evidence from the fork: final image booted, /healthz passed, and blue/green deployment completed without NAPI FATAL ERROR

⚠️ base-red inherited: #11449

@diegosouzapw
diegosouzapw force-pushed the fix/bun-runtime-strip-native branch from 1513500 to 4e2bb5c Compare August 25, 2026 23:33
@diegosouzapw
diegosouzapw merged commit 7b7196f into diegosouzapw:release/v3.8.51 Aug 25, 2026
4 of 7 checks passed
diegosouzapw pushed a commit that referenced this pull request Aug 25, 2026
…e Webpack fallback (#11471)

Validated in a combined 4-PR batch worktree off release/v3.8.51 tip (last of the Bun-native cluster; conflicted against the already-merged #11482's Dockerfile.bun hunk in the shared worktree — resolved by taking this PR's configurable ARG/ENV shape, which is exactly what it's designed to replace, and pushed the same resolution to this branch).
- Focused test: resolve-next-build-bundler-flag.test.mjs — 3/3 pass, part of batch's 5/5 node:test run
- typecheck:core, file-size, changelog-integrity, complexity, cognitive-complexity — all OK
- Full-repo lint: 228 pre-existing dashboard react-hooks/* findings, unrelated to this diff

Thanks for validating with both node --test and bun test — good practice given the dual-runtime surface this touches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants