From 3257ac89b9af616bfd02de07329461bff75013ef Mon Sep 17 00:00:00 2001 From: Andrew Prifer <2991360+AndrewPrifer@users.noreply.github.com> Date: Mon, 5 Dec 2022 11:50:53 +0100 Subject: [PATCH] Fix window reference error with SSR (#348) --- theatre/studio/src/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/theatre/studio/src/index.ts b/theatre/studio/src/index.ts index 1464e51..9003979 100644 --- a/theatre/studio/src/index.ts +++ b/theatre/studio/src/index.ts @@ -74,9 +74,12 @@ function registerStudioBundle() { export {default as ToolbarDropdownSelect} from './uiComponents/toolbar/ToolbarDropdownSelect' import {notify} from '@theatre/studio/notify' -// @ts-ignore -window[globalVariableNames.notifications] = { - notify, + +if (typeof window !== 'undefined') { + // @ts-ignore + window[globalVariableNames.notifications] = { + notify, + } } export type {IScrub} from '@theatre/studio/Scrub'