From 5eaa65b9a3faa8d943c61cee8f07dda30095f76f Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Sat, 30 May 2020 15:12:31 -0700 Subject: [PATCH] fix: wrap fetch --- 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 4f50a264..ea32c555 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/hello') - .then(response => response.json()) - .then(console.log) + if (typeof window !== 'undefined') { + fetch('/.netlify/functions/hello') + .then(response => response.json()) + .then(console.log) + } return (