schovi / react-iscroll

React component for wrapping iScroll http://iscrolljs.com/
MIT License
236 stars 60 forks source link

window is not defined #69

Open taeunChoi opened 6 years ago

taeunChoi commented 6 years ago

hello. I used this library. I added code like tutorial.

<ReactIScroll
    iScroll={iScroll}
>
    {els}
</ReactIScroll>

but error messages are

 { ReferenceError: window is not defined
    at Object.<anonymous> (/Users/taeun/dev/workspace/git/shopping-web/node_modules/iscroll/build/iscroll-lite.js:994:4)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.iscroll/build/iscroll-lite (/Users/taeun/dev/workspace/git/shopping-web/packages/search/build/mobile/server/bundle.js:7203:18)
    at __webpack_require__ (/Users/taeun/dev/workspace/git/shopping-web/packages/search/build/mobile/server/bundle.js:26:30)
    at Module../src/mobile/components/Search/RelatedTag.tsx (

Why does it say there is no window object?

D-TUCKER commented 6 years ago

Looks like an error in iscroll itself. Are you trying to run this somewhere where window would not be available?