effectussoftware / react-custom-roulette

Repository for the react-custom-roulette library
MIT License
322 stars 114 forks source link

Window is not defined #159

Closed Darrenwwk closed 6 months ago

Darrenwwk commented 6 months ago

Hi, I am using this package on my new nextjs project but getting this error ReferenceError: window is not defined at Object. (/Users/darren/Desktop/food-spin/node_modules/.pnpm/react-custom-roulette@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/react-custom-roulette/dist/bundle.js:1:238).

I guess this is because this package is trying to access window in server side but not in client side. May I know how to handle this?

wedwin53 commented 6 months ago

Hi, how do you solved the issue? @Darrenwwk

Darrenwwk commented 6 months ago

Hi, how do you solved the issue? @Darrenwwk

use dynamic from nextJs to import the package and close the server side rendering