Skip to content

fix(dev-dx): wasm sqlite fallback, silence PORT warning, dev auth Origin (#1875)#1898

Merged
os-zhuang merged 1 commit into
mainfrom
worktree-fix-1875-dev-dx
Jun 15, 2026
Merged

fix(dev-dx): wasm sqlite fallback, silence PORT warning, dev auth Origin (#1875)#1898
os-zhuang merged 1 commit into
mainfrom
worktree-fix-1875-dev-dx

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Summary

Three dev-DX fixes from #1875, surfaced while runtime-testing templates on Node 25.

  1. SQLite ABI mismatch → wasm fallback — dev's driver chain is now native better-sqlite3wasm SQLite → in-memory. When the native binary's ABI doesn't match the running Node (e.g. Node 25 NODE_MODULE_VERSION mismatch), dev keeps real SQL + persistence via SqliteWasmDriver instead of dropping to the non-persistent mingo in-memory driver. Same probe-by-connect() so load failures are caught at registration.
  2. PORT deprecation warning — added a { silent: true } option to readEnvWithDeprecation, applied at the OS_PORT/PORT call sites. PORT is an industry-standard alias PaaS platforms inject automatically, so the warning nagged operators about env they never set. Other legacy vars still warn.
  3. Auth Origin 403 — in dev (NODE_ENV !== 'production'), when a request has neither Origin nor Referer, handleRequest synthesizes a same-origin Origin from the request URL so better-auth's CSRF check passes for non-browser clients (curl/scripts). Production untouched.

Test

  • Full turbo build (53 tasks) passes — includes CLI's real tsc typecheck.
  • @objectstack/types 7/7, @objectstack/plugin-auth 118/118 (4 new Origin-injection cases), @objectstack/cli 322/322.

Closes #1875

🤖 Generated with Claude Code

…gin (#1875)

Three dev-DX fixes surfaced while runtime-testing templates:

1. SQLite ABI mismatch: dev now falls back native better-sqlite3 → wasm
   SQLite → in-memory. When the native binary's ABI doesn't match the
   running Node (e.g. Node 25 NODE_MODULE_VERSION mismatch), dev keeps
   real SQL + persistence via SqliteWasmDriver instead of dropping to the
   non-persistent mingo in-memory driver.

2. PORT warning: add a `{ silent: true }` option to readEnvWithDeprecation
   and use it at the OS_PORT/PORT call sites. PORT is an industry-standard
   alias that PaaS platforms inject automatically, so warning nagged
   operators about env they never set. Other legacy vars still warn.

3. Auth Origin 403: in dev, when a request has neither Origin nor Referer,
   handleRequest synthesizes a same-origin Origin from the request URL so
   better-auth's CSRF check passes for non-browser clients (curl/scripts).
   Production is untouched (gated on NODE_ENV).

Tests: types 7/7, plugin-auth 118/118 (4 new Origin cases + silent option),
cli 322/322; full turbo build (tsc typecheck) passes.

Closes #1875

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jun 15, 2026 7:14am

Request Review

@github-actions github-actions Bot added the tests label Jun 15, 2026
@os-zhuang
os-zhuang merged commit 18b6041 into main Jun 15, 2026
7 of 8 checks passed
@os-zhuang
os-zhuang deleted the worktree-fix-1875-dev-dx branch June 15, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P3] Dev DX: native sqlite driver ABI mismatch on newer Node; PORT→OS_PORT; auth Origin requirement

1 participant