Commit 84650c5
fix(driver-sql): don't dump a scary ERR_DLOPEN stack for the native→wasm probe (#2892)
* fix(driver-sql): don't dump a scary ERR_DLOPEN stack for the native→wasm probe
When native better-sqlite3 has an ABI mismatch (`NODE_MODULE_VERSION` after a
Node upgrade), `resolveSqliteDriver`'s probe deliberately triggers the lazy
`.node` load to detect it and steps down to wasm SQLite with a clean one-line
notice (#2229). But `SqlDriver.connect()`'s best-effort `PRAGMA auto_vacuum`
is the first query to force that load, so the failure surfaced there first and
was logged with the full multi-line `ERR_DLOPEN_FAILED` stack — twice — making
a handled, non-fatal step-down look like a fatal crash to anyone reading the
dev console.
Detect the native-addon load failure (`code === 'ERR_DLOPEN_FAILED'` or a
`NODE_MODULE_VERSION` message) in that catch and log a concise, actionable
one-liner instead of the stack, pointing at `pnpm rebuild better-sqlite3`. The
following step-down notice still explains the outcome. Any OTHER PRAGMA failure
keeps the full warning (with stack) unchanged. Purely a log-noise fix — control
flow and the fallback behavior are untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UUWGgTT5s7XgBb2eLtzhfU
* chore(changeset): patch @objectstack/driver-sql for the ERR_DLOPEN log-noise fix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UUWGgTT5s7XgBb2eLtzhfU
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a09aa95 commit 84650c5
2 files changed
Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
584 | 610 | | |
585 | 611 | | |
586 | 612 | | |
| |||
0 commit comments