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.

Ever since version 1.10.37 (probably .36) I’m getting a window undefined error. .35 works fine. I’m using Next JS so my app is SSR. Unfortunately I can’t figure out what causes the error only that in version .37 the start of lib/react-carousel.js looks like this (note the use of window)

!function (e, t) {
    'object' == typeof exports && 'object' == typeof module ? module.exports = t(require('react')) : 'function' == typeof define && define.amd ? define('react-carousel', ['react'], t) : 'object' == typeof exports ? exports['react-carousel'] = t(require('react')) : e['react-carousel'] = t(e.React)
}(window, (function (e) {
...

and in .35 it looks like this

!function (e, t) {
    'object' == typeof exports && 'object' == typeof module ? module.exports = t(require('react')) : 'function' == typeof define && define.amd ? define('react-carousel', ['react'], t) : 'object' == typeof exports ? exports['react-carousel'] = t(require('react')) : e['react-carousel'] = t(e.React)
}('undefined' != typeof self ? self : this, function (e) {
...

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
piotr-s-brainhubcommented, Jan 24, 2020

@EmilEriksen @klendi it’s fixed in @brainhubeu/react-carousel@1.10.39 (published manually)

2reactions
piotr-s-brainhubcommented, Jan 24, 2020

@EmilEriksen @klendi

We’re working on it. The easiest fix for now seems to be using a previous version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript: 'window' is not defined - Stack Overflow
The window object represents an open window in a browser. Since you are not running your code within a browser, but via Windows...
Read more >
How to solve "window is not defined" errors in React and Next.js
js world, window is not defined, window is only available in browsers. There are three ways to solve that: 1. First solution: typeof....
Read more >
What is function window, document, undefined - Medium
What is function window, document, undefined — window, document really means. In this post, we're going to explore what the title suggests, ...
Read more >
How To Solve ReferenceError window is not defined in ...
Fixing a window is not defined error can be quite simple. In most cases, all you will need to do is wrap your...
Read more >
[Solved] ReferenceError : window is not defined - ItsJavaScript
The ReferenceError : window is not defined error mainly occurs if you are using the window object in Node.js, React.js, Next.js.
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