question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when used with Gatsby: error "window" is not available during server side rendering.

See original GitHub issue

The project isn’t open source 😞 but here’s a relevant snippet from a build:

5:22:47 PM: error "window" is not available during server side rendering.
5:22:47 PM: 
5:22:47 PM: > 1 | !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Freezeframe=n():t.Freezeframe=n()}(window,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return
...

Visually, the top of the request gatsby-log.txt

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jonrriveracommented, Dec 21, 2020

hi everybody, I’m getting the same error when using next.js. I tried defining if (typeof window !== "undefined") { new Freezeframe(); } which removed the ‘window not defined error’, but now the project is not compiling. Please let me know if you need any further clarification. thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby window not available during server side rendering ...
I tried to read through the documentation on this issue and attempted to use their window check conditional, but my redirect either didn't...
Read more >
Gatsby build Error: "window" is not available during server ...
I have created an application and successfully integrated with MSAL to authenticate users using Azure AD. gatsby develop working fine.
Read more >
Gatsby - the window is not defined error, what and how to fix it?
Gatsby is a React-based framework. If the problematic code is in the component's render function, move that code into a useEffect hook or...
Read more >
Gatsby 'window.location' not available during SSR - Clint Vidler
Problem. Gatsby error message: failed Building static HTML for pages - 4.279s "location" is not available during server side rendering.
Read more >
Window is not defined in gatsby build : r/gatsbyjs - Reddit
failed Building static HTML for pages - 5.988s ERROR #95312 "window" is not available during server side rendering. See our docs page for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found