diff --git a/src/index.js b/src/index.js index 787dcda..b2e0442 100644 --- a/src/index.js +++ b/src/index.js @@ -18,8 +18,8 @@ const isWebWorker = const isJsDom = (typeof window !== "undefined" && window.name === "nodejs") || (typeof navigator !== "undefined" && - (navigator.userAgent.includes("Node.js") || - navigator.userAgent.includes("jsdom"))); + (navigator.userAgent?.includes("Node.js") || + navigator.userAgent?.includes("jsdom"))); const isDeno = typeof Deno !== "undefined" &&