Skip to content

Commit

Permalink
Fix SSR: Check window type
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Sep 20, 2024
1 parent 90a647f commit 44e1923
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@sfgrp/distinguish",
"private": false,
"type": "module",
"version": "0.3.1",
"version": "0.3.2",
"files": [
"dist"
],
Expand Down
4 changes: 3 additions & 1 deletion src/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function createInteractiveKey(
return app
}

window?.addEventListener('DOMContentLoaded', autoDiscover)
if (typeof window !== 'undefined') {
window.addEventListener('DOMContentLoaded', autoDiscover)
}

export { createInteractiveKey, discoverInteractiveKey, VueInteractiveKey }

0 comments on commit 44e1923

Please sign in to comment.