mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-24 16:12:23 +03:00
next.config.mjs aliased `better-sqlite3` to its build-time stub unconditionally, recording the premise that "runtime still uses the real package via serverExternalPackages". That premise does not hold: a Turbopack resolveAlias rewrites the request BEFORE the externals check runs, so the request stopped matching the serverExternalPackages entry and the stub was baked into the shipped bundle. Every artifact built from the release tip then answered HTTP 500 on every route -- the sync driver failed with "r(...) is not a constructor" (the minified stub export), fell through node:sqlite and sql.js, and the instrumentation hook aborted at boot. Same failure shape as #6344, one alias above it in the same object, so it gets the same treatment: a shared flag helper makes the alias opt-in via OMNIROUTE_BETTER_SQLITE3_STUB=1, and a default build externalizes the real native addon. Nobody sets the flag today; it exists for a build host that genuinely hits the SIGABRT worker teardown from #10060, and such a build is not shippable -- which the helper and the stub header now say explicitly instead of describing the stub as a harmless build-only stand-in. Closes #11343