diff --git a/src/lib/db/client.ts b/src/lib/db/client.ts index 7898963..cafd424 100644 --- a/src/lib/db/client.ts +++ b/src/lib/db/client.ts @@ -1,6 +1,7 @@ import { Kysely, Migrator } from 'kysely'; import { SQLocalKysely } from 'sqlocal/kysely'; import type { Schema } from './schema'; +import { migrations } from './migrations/'; const sqlocal = new SQLocalKysely('sticky-notes.db'); const kysely = new Kysely({ dialect: sqlocal.dialect }); @@ -11,7 +12,10 @@ const migrator = new Migrator({ db: kysely, provider: { async getMigrations() { - const { migrations } = await import('./migrations/'); + // TODO: Dynamic import does not work in production build + // because the imported chunk imports `sql` from the same + // chunk that imports it, so circular dependency. Vite bug. + // const { migrations } = await import('./migrations/'); return migrations; }, },