throwing ReferenceError: window is not defined, when code render on server SSR
See original GitHub issuethis can be corrected using
typeof window !== "undefined"? (() => {window.Splide = complete_Splide;})(): "";
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top Results From Across the Web
React JS Server side issue - window not found - Stack Overflow
So I use process.env.BROWSER to my advantage because it will be defined as undefined if it is server side, and it will be...
Read more >How to solve Next.js window is not defined
Solve a the common ReferenceError: next.js window is not defined error that you may see when doing SSR & pre-rendering.
Read more >referenceerror: window is not defined, how to solve
window is an object that's made available by the browser, and it's not available in a server-side JavaScript environment. I describe the window...
Read more >How to solve "window is not defined" errors in React and Next.js
Next.js is a React framework with pre-rendering abilities. ... Then it will fail with "ReferenceError: window is not defined":.
Read more >Using window in React SSR: The Complete Guide
window is not defined on the server, so you can't use it during the render of a component being SSR'd. ... During a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Juliangzr - I had the same experience. I thought I might be doing something wrong, but it seems like I’m not the only one.
If you check out my fork, that simple change fixed it for me.
Close the issue due to the major version update. Feel free to create a new issue or open a new discussion.
Solved in v3.