-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'ReferenceError: navigator is not defined' for Next.js apps #124
Comments
I found a hack that fixes it. Broken: import CameraControls from 'camera-controls';
CameraControls.install({ THREE }); Working: const CameraControls = typeof window !== `undefined` ? require("camera-controls").default : null;
if(CameraControls) CameraControls.install({ THREE }); |
Ah, that's right. I'll work on it this weekend, or you can make a PR for it if you like. |
I think this should be solved with #125 |
Awesome, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use this library within my Next.js app, and I'm getting a
ReferenceError: navigator is not defined
thrown by this line, sincenavigator
is not defined on the server side.camera-controls/src/CameraControls.ts
Line 26 in 71ffdc4
The text was updated successfully, but these errors were encountered: