Skip to content

Commit 0aa380b

Browse files
hsnice16claude
andcommitted
Include data/rank.db in Next.js serverless function trace
Without outputFileTracingIncludes, Next.js's static analysis can't follow the runtime-computed path in lib/db.ts, so the DB file was missing from the Vercel function bundle — committed re-seeds weren't reaching prod. Matches all routes since 5 of them read the DB. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0b54f09 commit 0aa380b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

next.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import type { NextConfig } from "next";
22

3-
const config: NextConfig = {};
3+
// lib/db.ts opens data/rank.db via `join(process.cwd(), ...)`, which Next.js's
4+
// static file tracer can't follow — without this, the DB is missing from the
5+
// serverless function bundle on Vercel and /api/repos returns stale data.
6+
const config: NextConfig = {
7+
outputFileTracingIncludes: {
8+
"*": ["./data/rank.db"],
9+
},
10+
};
411

512
export default config;

0 commit comments

Comments
 (0)