From 9e0010924ca33f509080c609671d0747bc964602 Mon Sep 17 00:00:00 2001 From: Nathan Sarrazin Date: Fri, 3 May 2024 11:08:17 +0200 Subject: [PATCH] don't return db during building --- src/lib/server/database.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/server/database.ts b/src/lib/server/database.ts index 31f4191bfb3..4a8302ce9ca 100644 --- a/src/lib/server/database.ts +++ b/src/lib/server/database.ts @@ -14,6 +14,7 @@ import type { MigrationResult } from "$lib/types/MigrationResult"; import type { Semaphore } from "$lib/types/Semaphore"; import type { AssistantStats } from "$lib/types/AssistantStats"; import { logger } from "$lib/server/logger"; +import { building } from "$app/environment"; export const CONVERSATION_STATS_COLLECTION = "conversations.stats"; @@ -203,4 +204,6 @@ export class Database { } } -export const collections = Database.getInstance().getCollections(); +export const collections = building + ? ({} as unknown as ReturnType) + : Database.getInstance().getCollections();