From 84057788b3912f54b86923dac0d13a7c4232fdd1 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Sat, 8 Oct 2022 13:27:33 +0200 Subject: [PATCH] Fix undefined window error --- lib/content/generateBrowser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/content/generateBrowser.ts b/lib/content/generateBrowser.ts index 3d1207c..9f4d62e 100644 --- a/lib/content/generateBrowser.ts +++ b/lib/content/generateBrowser.ts @@ -10,7 +10,7 @@ const projectServerErrorHtml = `
Sorry! A server error ha const ad = asciidoctor(); -const isDev = window?.location?.host.startsWith("dev") || false; +const isDev = typeof window !== "undefined" ? window.location.host.startsWith("dev") : false; export async function generateContent(content: Project|Diary, selectedPage?: number): Promise { if(!content) return projectEmpty;