AramRafeq / semantic-ui-carousel-react

carousel component for semantic ui react
MIT License
9 stars 3 forks source link

ReferenceError: window is not defined #1

Closed jimmy2012 closed 5 years ago

jimmy2012 commented 5 years ago

It happend when i use the example. Can u fix it?

error like this:

at /Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:64302:2
at /Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:64291:46
at module.exports.module.exports (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:64359:88)
at Object.<anonymous> (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:64144:38)
at __webpack_require__ (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:21:30)
at Object.<anonymous> (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:19473:1)
at __webpack_require__ (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:21:30)
at Object.<anonymous> (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:19446:17)
at __webpack_require__ (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:21:30)
at /Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:64:18
at Object.<anonymous> (/Users/jimwong/Documents/Nodejs/semantic-ui/carousel/node_modules/semantic-ui-carousel-react/build/index.js:67:10)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
AramRafeq commented 5 years ago

i did not reference window anywhere in my code be sure that window instance is available then render the component, i suspect that occurs when using server side rendering as there is no window object on the server

jimmy2012 commented 5 years ago

I have fixed it already at afternoon this day. Thx a lot!