sakhnyuk / rc-scrollbars

React scrollbars component
https://rc-scrollbars.vercel.app/
MIT License
145 stars 14 forks source link

V[1.1.1] window is not defined - NextJs #20

Closed kito22 closed 3 years ago

kito22 commented 3 years ago

first thanks for the excellent work, supporting this library.

I am trying to use this library with NextJs. I am using the "universal" property, as recommended in the documentation, but even so I always get the following error:

ReferenceError: window is not defined

The error indicates the following files: rc-scrollbars\lib\utils\getScrollbarWidth.js:8:15) rc-scrollbars\lib\utils\index.js:11:27)

I also tried to copy the example from the documentation, but I was also unsuccessful. Am I doing something wrong?

i am using NjextJs in 9.5.4 version

sakhnyuk commented 3 years ago

Hello @kito22

Yeah, that's bug comes from the last release. I'll fix that today.

sakhnyuk commented 3 years ago

@kito22 I've released v1.1.2 with window object check.

kito22 commented 3 years ago

Thanks, @sakhnyuk. It's working perfectly,

thanks for your effort.