From 75055361fd9ddcfd80bfba040b5e699a8ddb6747 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Mon, 6 Apr 2020 06:48:16 -0400 Subject: [PATCH] check for presence of `window` first --- src/runtime/internal/globals.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/internal/globals.ts b/src/runtime/internal/globals.ts index 831555163f..b97f81ab9f 100644 --- a/src/runtime/internal/globals.ts +++ b/src/runtime/internal/globals.ts @@ -1,7 +1,7 @@ declare const global: any; -export const globals = (typeof globalThis !== 'undefined' - ? globalThis - : typeof window !== 'undefined' +export const globals = (typeof window !== 'undefined' ? window + : typeof globalThis !== 'undefined' + ? globalThis : global) as unknown as typeof globalThis;