-
Notifications
You must be signed in to change notification settings - Fork 10
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
Using window causes server side rendering to fail #20
Comments
Thank you for the bug report 😊. I will investigate this issue and try to get back to you as soon as I can. |
This is how I handle it
|
@akoskovacs Are you still facing this issue? Could you help me reproduce it with a sample codesandbox? |
I tried the code from @rash3ye above in a Next.js project, and still see this issue. It is clearly the server side rendering that is causing the issue, because it checks for window. |
Using Next.js also. When refreshing will hit the |
For Next.js, I am using dynamic import with const TrixEditor = dynamic(() => import("form-controls/TrixEditor"), {
ssr: false,
loading: () => <p>Loading editor...</p>,
});
const NoteExample = () => {
return (
<TrixEditor />
)
} |
Hi!
I tried to use
react-trix-rte
in SSR context. Of couse this means nowindow
ordocument
object exist, but the editor tries to access that.This is the error I am getting:
ReactOnRails::PrerenderError in Posts#index
Related gems used:
Code used:
The text was updated successfully, but these errors were encountered: