Skip to content

fix(marketplace): 改用 node:sqlite 修复 Vercel 构建,移除原生 sqlite 依赖 - #8

Merged
JS-mark merged 1 commit into
mainfrom
agent/devops-agent/4fa9a0c1
Jul 25, 2026
Merged

fix(marketplace): 改用 node:sqlite 修复 Vercel 构建,移除原生 sqlite 依赖#8
JS-mark merged 1 commit into
mainfrom
agent/devops-agent/4fa9a0c1

Conversation

@JS-mark

@JS-mark JS-mark commented Jul 24, 2026

Copy link
Copy Markdown
Owner

修复 marketplace Vercel 部署:改用 Node 内置 node:sqlite

根因(本地实证纠正了原 Issue 的"死依赖"判断)

better-sqlite3 / sqlite3 不是死依赖——@nuxt/content构建期通过 db0 连接器用它们生成本地 content SQLite dump(getLocalDatabasedb0/connectors/better-sqlite3)。直接删除会导致构建报错 Could not locate the bindings file(这也是历史 commit f2478fa "allow native sqlite build" 的由来)。

修复

  • content.experimental.nativeSqlite: true:让构建期本地 SQLite 走 Node 内置 node:sqlite,从根本上不再需要 better-sqlite3 / sqlite3 的 node-gyp 原生编译。
  • apps/marketplace devDependencies 与根 pnpm-workspace.yamlonlyBuiltDependencies 移除 better-sqlite3 / sqlite3,更新 lockfile。
  • engines.node >= 22.5.0:保证 Vercel 构建容器具备 node:sqlite
  • README 补充 Vercel Root Directory / Blob Store 设置说明。

本地验证

  • pnpm install --frozen-lockfile ✅,日志显示 Ignored build scripts: ...better-sqlite3, ...sqlite3无 node-gyp 编译
  • NITRO_PRESET=vercel STORAGE_DRIVER=vercelBlob pnpm --filter @aspect-mark/marketplace... build✨ Build complete!,产物 apps/marketplace/.vercel/output,体积 12.8MB → 10.9MB。

仍需人工在 Vercel 侧确认

  • Root Directory = apps/marketplace
  • Storage → Create Blob Store(注入 BLOB_READ_WRITE_TOKEN
  • 确认 Node 运行时 ≥ 22.5

…e sqlite deps

- content.experimental.nativeSqlite=true 让构建期本地 SQLite 走 Node 内置
  node:sqlite,彻底摆脱 better-sqlite3 / sqlite3 的 node-gyp 原生编译
- 从 marketplace devDependencies 与根 pnpm-workspace onlyBuiltDependencies
  移除 better-sqlite3 / sqlite3,更新 lockfile
- engines.node>=22.5.0 保证 Vercel 构建容器支持 node:sqlite
- README 补充 Vercel Root Directory / Blob Store 设置说明

Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
skills-marketplace Ready Ready Preview, Comment Jul 24, 2026 4:44pm

@JS-mark
JS-mark merged commit 4402ddf into main Jul 25, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant