diff --git a/src/helpers.ts b/src/helpers.ts index 9117ee7..cf18722 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -13,7 +13,9 @@ export const detectSSR = (): boolean => { // @ts-ignore const isDeno = typeof Deno !== 'undefined' const hasWindow = typeof window !== 'undefined' ? true : false - return (typeof _nano !== 'undefined' && _nano.isSSR) || isDeno || !hasWindow + const isNodejs = navigator.userAgent.includes('Node.js') || window.name == 'nodejs' + const iJsdom = navigator.userAgent.includes('jsdom') + return (typeof _nano !== 'undefined' && _nano.isSSR) || isDeno || !hasWindow || isNodejs || iJsdom } function isDescendant(desc: ParentNode | null, root: Node): boolean {