fix(core): default #sqlite resolution to the node driver - #41834
Open
kitlangton wants to merge 1 commit into
Open
fix(core): default #sqlite resolution to the node driver#41834kitlangton wants to merge 1 commit into
kitlangton wants to merge 1 commit into
Conversation
kitlangton
force-pushed
the
bun-sqlite-gate
branch
from
August 11, 2026 20:27
fe0e9f4 to
4cf45a3
Compare
kitlangton
force-pushed
the
bun-sqlite-gate
branch
from
August 11, 2026 20:48
4cf45a3 to
1e747ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Repoints the
defaultcondition of the#sqlitesubpath import fromsqlite.bun.tstosqlite.node.ts, and adds a bundling smoke test that pinsbun:sqliteout of non-Bun bundles ofdatabase.ts.Why
sqlite.bun.tshas a staticimport { Database } from "bun:sqlite". Any non-Bun bundle that resolves#sqliteto it crashes at module load on the unresolvablebun:sqlitespecifier — downstream workerd embedders currently carry wrangler alias/stubs to work around this.#41659 added the
workerdcondition (so wrangler's["workerd", "worker", "browser"]set resolves tosqlite.workerd.ts), butdefaultstill pointed at the bun variant: any bundler without thebun,node, orworkerdcondition (browser-target esbuild/Bun.build, or a workerd toolchain that drops the condition) selectedsqlite.bun.tsand shipped the crash. Reproduced at v2 head: a browser-conditionsBun.buildofdatabase.tsbundlesSqliteBunand thebun:sqlitespecifier.How
packages/core/package.json:#sqlitenow mapsworkerd→ workerd driver,bun→bun:sqlitedriver,node/default→ thenode:sqlitedriver. Bun and Node runtimes match their own conditions first, so their resolution is unchanged; only the fallback moves off the Bun-only module.packages/core/test/sqlite-bundle.test.ts: buildsdatabase.tswithBun.build, externalizing bare imports so only core-relative modules (including the#sqliteresolution) are bundled, and asserts:conditions: ["workerd"]selects the Durable Object driver with nobun:sqliteornode:sqlitein the outputSqliteNode, neverbun:sqliteThe dynamic
import("bun:sqlite")inv1-migration.tsis lazy and unaffected; it does not appear in either bundle.Scope
packages/coreonly: one condition-map line plus a new test file.Testing
packages/core:bun run typecheckclean;bun testgreen (1666 pass, 0 fail) including the new bundle testbun run typecheckclean (33/33 tasks)bunx oxlinton touched files: 0 errors, 0 warnings