Skip to content

Commit c6dbf45

Browse files
authored
Add window check to enable server-side rendering
1 parent bc887ca commit c6dbf45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/polyfills.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// src: http://stackoverflow.com/questions/6481612/queryselector-search-immediate-children
99

1010
/*eslint-disable */
11-
;(function (doc, proto) {
11+
12+
if (typeof window !== 'undefined')
13+
(function (doc, proto) {
1214
try { // check if browser supports :scope natively
1315
doc.querySelector(':scope body')
1416
} catch (err) { // polyfill native methods if it doesn't

0 commit comments

Comments
 (0)