From fe2d99d36dda4f1ae00b471d583be27ed1356bbe Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Thu, 16 Dec 2021 11:39:58 +0100 Subject: [PATCH] fix: prevent SSR crash --- src/components/Tippy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Tippy.ts b/src/components/Tippy.ts index d7aec03..9a9e813 100644 --- a/src/components/Tippy.ts +++ b/src/components/Tippy.ts @@ -81,7 +81,7 @@ const TippyComponent = defineComponent({ let target: any = elem if (props.to) { - if (props.to instanceof Element) { + if (typeof Element !== 'undefined' && props.to instanceof Element) { target = () => props.to } else if (typeof props.to === 'string' || props.to instanceof String) { target = () => document.querySelector(props.to)