Skip to content
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

Orbit Controls didn't work on NextJS but works on regular React #2

Open
ArgeekBrambo opened this issue Mar 17, 2024 · 4 comments
Open

Comments

@ArgeekBrambo
Copy link

First Im building this with NextJS, everything was fine until we implement orbit controls. Been searching for hours but I didn't get any solution. Then I start anew with regular react and the orbit controls work fine. Why is that ? and how to fix it for NextJS ?

@getFrontend
Copy link

Don't forget the client side and server side using Next, and then I'm sure you'll find a solution 😉

@ArgeekBrambo
Copy link
Author

Thanks for the reply.

I already use "client side", but still won't work. Haven't found any solution tho

@getFrontend
Copy link

in Figma clone on Next JS was the same problem. To resolve it: we disable ssr to avoid pre-rendering issues of Next.js because we're using a canvas element that can't be pre-rendered by Next.js on the server.

page.tsx

import dynamic from "next/dynamic";

const App = dynamic(() => import("./App"), { ssr: false });

export default App;

app.tsx

const Home = () => {
  return (
    <div>Home</div>
  )
}

export default Home

@EssiJunior
Copy link

in Figma clone on Next JS was the same problem. To resolve it: we disable ssr to avoid pre-rendering issues of Next.js because we're using a canvas element that can't be pre-rendered by Next.js on the server.

page.tsx

import dynamic from "next/dynamic";

const App = dynamic(() => import("./App"), { ssr: false });

export default App;

app.tsx

const Home = () => {
  return (
    <div>Home</div>
  )
}

export default Home

I'm also implementing this tutorial with Next.js.

The VideoCarroussel component wasn't working till I applied this. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants