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 is not defined [gatsby-js and netlify] #1

Closed
Gervwyk opened this issue Oct 15, 2018 · 3 comments
Closed

window is not defined [gatsby-js and netlify] #1

Gervwyk opened this issue Oct 15, 2018 · 3 comments

Comments

@Gervwyk
Copy link

Gervwyk commented Oct 15, 2018

I'm testing react-gsap with gatsby and deploying it with netlify, running into this error:

4:15:49 PM:   8366 | function PlugInSvgDraw () {
4:15:49 PM: > 8367 |   var _gsScope = typeof module !== "undefined" && module.exports && typeof global !== "undefined" ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
4:15:49 PM:        | ^
4:15:49 PM:   8368 |   (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push(function () {
4:15:49 PM:   8369 |
4:15:49 PM:   8370 |     // from https://github.com/juliangarnier/anime/blob/master/anime.js
4:15:49 PM: 
4:15:49 PM:   WebpackError: ReferenceError: window is not defined

Maybe you can change the condition to test if window is defined:
gatsbyjs/gatsby#309

Really like how you structured these components!

@bitworking
Copy link
Owner

Thanks for testing and sending this issue. SSR compatibility is on my list and I hope I can fix it today and push a new release.

@bitworking
Copy link
Owner

I've added a simple window check and tested it in Gatsby. It should work now in v1.0.13.

@Gervwyk
Copy link
Author

Gervwyk commented Oct 16, 2018

Thanks its working!

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

2 participants