window undefined
See original GitHub issueEver 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:
- Created 4 years ago
- Comments:11 (8 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
@EmilEriksen @klendi it’s fixed in @brainhubeu/react-carousel@1.10.39 (published manually)
@EmilEriksen @klendi
We’re working on it. The easiest fix for now seems to be using a previous version.