-
Notifications
You must be signed in to change notification settings - Fork 186
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: document is not defined" in server-side rendering #50
Comments
We are having the same issue and we would very much appreciate it if someone can look into fixing it as this layout has such great potential but is failing when server side rendering.
Thanks in advance to whoever fixes it :) |
It looks like such a workaround maybe have already been applied here? Line 5 in 989112f
However, is this library really going to work for SSR at all? I was looking at the main FlexLayout/src/view/Layout.tsx Line 456 in 989112f
It says it uses the first render to do some measurement (which sounds unlikely to work in SSR), and only renders the layout on subsequent renders. Since |
Server-side rendering gets me the following exception at import time:
DragDrop
has a default instance, which tries to create adiv
at construction time, which fails on the server. Unfortunately, this fails at construction time so it can only be fixed by conditional importing of the module, and not rendering on the server. Preferably of course, rendering would work on the server; drag & drop is not needed there.I'm using the React Starter Kit, which provides server-side rendering.
The text was updated successfully, but these errors were encountered: