From e887b36e0735bd1e00cea3989ee02b5611d811c6 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 11 Dec 2024 13:34:36 +0100 Subject: [PATCH] fix: build --- src/lib/stores/sdk.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index 5ae1b6de3..76b7064e5 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -31,10 +31,12 @@ import { SUBDOMAIN_NYC, SUBDOMAIN_SYD } from '$lib/constants'; +import { building } from '$app/environment'; export function getApiEndpoint(region?: string): string { + if (building) return ''; const url = new URL( - VARS.APPWRITE_ENDPOINT ? VARS.APPWRITE_ENDPOINT : globalThis?.location.toString() + VARS.APPWRITE_ENDPOINT ? VARS.APPWRITE_ENDPOINT : globalThis?.location?.toString() ); const protocol = url.protocol; const hostname = url.hostname;