diff --git a/gatsby-browser.js b/gatsby-browser.js index d523cbd9..ac20eaaa 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -4,6 +4,8 @@ * See: https://www.gatsbyjs.org/docs/browser-apis/ */ -exports.onInitialClientRender = () => { - require("intersection-observer") +export const onClientEntry = async () => { + if (typeof IntersectionObserver === "undefined") { + await import("intersection-observer") + } }