Fix calling client-side only function on server.