Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window for intersection-observer #1

Open
Frithir opened this issue Oct 24, 2018 · 0 comments
Open

Window for intersection-observer #1

Frithir opened this issue Oct 24, 2018 · 0 comments

Comments

@Frithir
Copy link
Contributor

Frithir commented Oct 24, 2018

https://www.gatsbyjs.org/docs/debugging-html-builds/

Some of your code references “browser globals” like window or document. If this is your problem you should see an error above like “window is not defined”. To fix this, find the offending code and either a) check before calling the code if window is defined so the code doesn’t run while Gatsby is building (see code sample below) or b) if the code is in the render function of a React.js component, move that code into componentDidMount which ensures the code doesn’t run unless it’s in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant