From 231cb8299c4945a6c2d497ae9ed09be70e4cc2d9 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Sat, 30 May 2020 20:44:08 -0700 Subject: [PATCH] fix: window --- src/pages/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index de91588f..bbfab3d3 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -27,9 +27,11 @@ const Hero = () => { const theme = useTheme() const date = new Date() - fetch('/.netlify/functions/page-views') - .then(response => response.json()) - .then(console.log) + if (typeof window === 'undefined') { + fetch('/.netlify/functions/page-views') + .then(response => response.json()) + .then(console.log) + } return (