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.

throwing ReferenceError: window is not defined, when code render on server SSR

See original GitHub issue

https://github.com/Splidejs/splide/blob/b859e88cb269e0509856fe51960618a415de0777/dist/js/splide.js#L5857

image

this can be corrected using

typeof window !== "undefined"? (() => {window.Splide = complete_Splide;})(): "";

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
CptCornWaultcommented, Mar 28, 2021

@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.

0reactions
NaotoshiFujitacommented, Oct 9, 2021

Close the issue due to the major version update. Feel free to create a new issue or open a new discussion.


Solved in v3.

Read more comments on GitHub >

github_iconTop 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 >

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