diff --git a/src/components/SEO.jsx b/src/components/SEO.jsx index 0839dd5d24..92e75aab28 100644 --- a/src/components/SEO.jsx +++ b/src/components/SEO.jsx @@ -9,7 +9,11 @@ import React from 'react'; import { Script } from 'gatsby'; -function getAdThriveScriptUrl(w) { +function getAdThriveScriptUrl() { + if (typeof window === 'undefined') { + return ''; + } + const w = window; w.adthrive = w.adthrive || {}; w.adthrive.cmd = w.adthrive.cmd || []; w.adthrive.plugin = 'adthrive-ads-manual'; @@ -60,11 +64,7 @@ export const SEO = ({ title, seoDescription, keywords }) => { name="twitter:image" content="https://github.com/holtzy/The-Python-Graph-Gallery/blob/master/static/overview_PGG.png?raw=true" /> -