Netlify Identity suddenly giving 'window is not defined' error today after no logic changes

See the following screenshot…

We’ve been using the Netlify Identity Widget on a Gatsby site for several months now, but today when trying to build we’re suddenly getting a “WebpackError: ReferenceError: window is not defined” error. We’ve made no logic changes. netlifyIdentity.init() is in componentDidMount(), so I’m not sure why gatsby-ssr is even trying to run netlifyIdentity.init()?

Any ideas anyone?

I just started using the netlify-identity-widget on my site today, and while everything ran well locally, the build wouldn’t succeed for a similar reason. Every time that I am using the widget it is within a componentDidMount, so not exactly sure what is going wrong there. My workaround was to disable pre-rendering for now, so my build command looks like: preact build --no-prerender since I am using preact. If you have figured out what the issue is by now, would be great to know!

Another thing to check would be version differences between the last build that succeeded and the one that is failing. Could you check those and let us know what you find?

Alternatively, you could try @JesseKuntz suggestion. :slight_smile:

@Dennis netlify-identity-widget v1.5.6 is working without problems. When I update to v1.8.0 then I get the error. When I rollback to v1.5.6 everything works fine again.

It seems someone logged the same issue on Github this morning…


…so guess I’ll keep an eye on that.

thanks for posting that, chocobuckle.