extremely claude-assisted go game based on atproto! working on cleaning up and giving a more unique design, still has a bit of a slop vibe to it.

Fix database require error in ESM module

- Use createRequire from module to enable CommonJS require in ESM
- Keep getDb synchronous to avoid breaking all callers
- Fix 'require is not defined' error in local development

+4 -1
+4 -1
src/lib/server/db.ts
··· 1 1 import { Kysely, SqliteDialect } from 'kysely'; 2 2 import { D1Dialect } from 'kysely-d1'; 3 3 import type { App } from '@sveltejs/kit'; 4 + import { createRequire } from 'module'; 5 + 6 + const require = createRequire(import.meta.url); 4 7 5 8 export interface GameRecord { 6 9 id: string; // AT URI (game_at_uri) ··· 28 31 function initLocalDb(): Kysely<Database> { 29 32 if (localDb) return localDb; 30 33 31 - // Dynamic import for local development only 34 + // Use CommonJS require for local development 32 35 const Database = require('better-sqlite3'); 33 36 const fs = require('fs'); 34 37 const path = require('path');