-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
webpack build causes errors with server-side rendering #69
Comments
After spending some times for this problem, i found this solution you just need to use dynamic on the import
|
Good stuff @acj97 , I solve this problem in the same way. However got another one, when I tried to use CytoScape with Layout extension. For example when I use it with Have you come across the same thing? |
When we use this library in a server-side rendering environment, we get the error
ReferenceError: window is not defined
if you look at the source, it looks like the error is at line
1:456
which maps to wherewindow
is referenced in this formatted version.This means
window
is referenced on module import, so even if we wait to render the component until it is mounted (i.e., in the browser) we get this error from module import alone. We have a work around to lazy load the module when a parent component is mounted, but it's a lot of setup just to work.This SO question suggests that it may be your webpack output configuration.
The text was updated successfully, but these errors were encountered: