nuxt / nuxt/content

Support force `node:sqlite` instead of `bun:sqlite` when enabling native DB connector in Bun

Open
#3,758 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.7k
Forks
746
Avg merge
1d 16h
Merged PRs (30d)
3

Description

Environment
Operating system Windows 10.0.26200
CPU Intel(R) Core(TM) Ultra 5 225H (14 cores)
Node.js version v24.9.0
nuxt/cli version 3.34.0
Package manager bun@1.3.11
Nuxt version 4.4.2
Nitro version 2.13.3
Builder rolldown-vite@7.3.1
Config appConfig, app, compatibilityDate, content, css, devServer, devtools, fonts, hooks, icon, llms, modules, ogImage, site, sitemap, vite
Modules @nuxt/ui@4.6.1, @nuxt/content@3.12.0, @nuxtjs/seo@5.1.0, @vueuse/nuxt@14.2.1, nuxt-llms@0.2.0
Version

v3.12.0

Reproduction

https://codesandbox.io/p/devbox/tender-pascal-dyzh65

Description

I'm using Bun locally, and deploy to Cloudflare Workers. When enabling content.experimental.sqliteConnector = 'native' with bun run build, it automatically uses bun:sqlite even though node:sqlite is also supported in Bun, but Cloudflare can't recognize bun:sqlite, so it fails:

[nitro 4:59:23 AM] ℹ Building Nuxt Nitro server (preset: cloudflare-module, compatibility date: 2026-04-05)

[nitro 4:59:30 AM]  ERROR  Error: Cannot resolve "bun:sqlite" from "/project/workspace/node_modules/.pnpm/db0@0.3.4/node_modules/db0/dist/connectors/bun-sqlite.mjs" and externals are not allowed!


undefined

2027 |           if (_resolved) {
2028 |             return { id: _resolved, external: false };
2029 |           }
2030 |         }
2031 |         if (!resolved || resolved.external && !id.endsWith(".wasm")) {
2032 |           throw new Error(
                           ^
error: Cannot resolve "bun:sqlite" from "/project/workspace/node_modules/.pnpm/db0@0.3.4/node_modules/db0/dist/connectors/bun-sqlite.mjs" and externals are not allowed!
     plugin: "commonjs--resolver",
       hook: "resolveId",
 watchFiles: [...],
       code: "PLUGIN_ERROR"

      at resolveId (/project/workspace/node_modules/nitropack/dist/rollup/index.mjs:2032:21)

Maybe there the sqliteConnector can be ... | 'native-node' | 'native-bun' to support explicitly avoid the problem.

Note: Add run.bun = true to bunfig.toml to make sure node xxx child-processes are routed to Bun

Additional context

No response

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and inspect how content.experimental.sqliteConnector is handled when building with Bun for the cloudflare-module preset. Check bunfig.toml's run.bun setting as noted in the report. Done means a native connector choice using node:sqlite can build for Cloudflare without bun:sqlite resolution errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, node.js, typescript
Domain
cloud, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.