Read this for Vercel, CI, runtime, dependency upgrades, and deployment failures.
- Preferred local/runtime Node: 22 LTS.
- Root
package.jsonengines: Node>=20 <25, npm>=10. better-sqlite3is the native SQLite dependency. Rebuild it after Node version changes..nvmrcis expected to point at Node 22.
Root:
npm run build
npm run dev
npm run start
npm run type-check
npm run lintWorkspace:
npm run build --workspace=apps/webImportant:
apps/web/package.jsonusesnext build --webpack.apps/web/vercel.jsonforces Vercel to runnpm run build.- Keep this explicit until Turbopack has been revalidated with the current Tailwind/Next stack.
- Do not set
turbopack.rootwhile the project is webpack-backed; Vercel/Next may also setoutputFileTracingRoot, and mismatched roots produce noisy build warnings.
- Project:
run2 - Root directory:
apps/web - Production branch:
master - Production aliases include:
https://run2.miaowu.orghttps://run2-joey-huangs-projects.vercel.app
- Node version on project should stay aligned to Node 22.x.
Known deploy trap:
- If Vercel uses
next builddirectly, it may invoke a different bundler path than local verification. - Keep project-level or repo-level build command as
npm run build.
- Workflow:
.github/workflows/quality-gate.yml - Should run install, type-check, lint, build, and API smoke checks.
- Type-check and lint should be treated as current quality gates after the 2026-04-30 legacy cleanup.
- API smoke checks should hit:
/api/debug/api/stats/api/sync/history/api/data-sources
- Next/React stack is already major-upgraded to Next 16 and React 19.
- Keep
eslintaligned with Next 16. - Avoid reintroducing
sqlite3; usebetter-sqlite3. - After npm changes run:
npm install
npm run build
npm audit- Check latest deploy logs first.
- Confirm Vercel project is
run2, not another similarly named project. - Confirm root directory is
apps/web. - Confirm build command is
npm run build. - Reproduce locally with
npm run build. - For native module errors, confirm Node version and rebuild
better-sqlite3.
Native module note:
- If logs mention
NODE_MODULE_VERSIONorbetter_sqlite3.node, first run under.nvmrc(nvm use 22) and rebuild only if the mismatch persists.