// Open the game DB once at server boot (Next ≥15 instrumentation hook; runs under `next dev` // and `next start`) so the ./db volume file exists from first start, before any request. // Dynamic import inside the runtime guard: lib/db/client.ts uses node:fs + sql.js, which must // never be pulled into the Edge Runtime instrumentation bundle (Next bundles register() for both). export async function register() { if (process.env.NEXT_RUNTIME === 'nodejs') { const { getGameDb } = await import('@/lib/db/client'); void getGameDb(); } }