Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Support for SSG/SSR? #14

Open
Blackglade opened this issue Aug 9, 2021 · 3 comments
Open

Support for SSG/SSR? #14

Blackglade opened this issue Aug 9, 2021 · 3 comments

Comments

@Blackglade
Copy link

Using React-based frameworks like NextJS or GatsbyJS causes issues with server side rendering / generation due to the fact that the window obj is undefined at build time (see attached screenshot). Possible to patch a fix that prevents this issue?
Screen Shot 2021-08-08 at 5 09 48 PM

@utkarshdubey
Copy link
Owner

Not really, but this looks interesting. We'd have to rewrite the runtime in a way that doesn't rely on window variables.

@adalbertopc
Copy link

You can use react-spline on NextJs by using this:

import dynamic from "next/dynamic";

const DynamicComponentWithNoSSR = dynamic( () => import("../components/spline/MyComponent"), { ssr: false } );

Then use it as a normal component

<DynamicComponentWithNoSSR />

@Blackglade
Copy link
Author

Thanks @adalbertopc. I ended up doing something similar to this.

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

No branches or pull requests

3 participants