Help porting from Create-react-app to Vite

Need help porting from create-react-app [ CRA ] to Vite

I want to port the client side of this repo to vite react
i tried multiple times but the sockets seems to get disconnect immediately

This is the repo where i tried porting you can use that repo or the original repo

The issue right now is everything works the sockets connect and everything but
because of the useEffect in Room.jsx the sockets are getting disconnected and so whenever a new user tries to join the same room they can see the old user

It would be epik if you could figure out and help me port it to vite react
Thank you in advance !