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

server side rendering is failing #4

Closed
YarivGilad opened this issue Apr 16, 2016 · 3 comments
Closed

server side rendering is failing #4

YarivGilad opened this issue Apr 16, 2016 · 3 comments

Comments

@YarivGilad
Copy link

YarivGilad commented Apr 16, 2016

Universal apps rendering their initial render on the server cannot use this library since it has a document and window dependency.
Please add to your script logic the following test to check if this is running in fact on the client...

var canUseDOM = !!(
  typeof window !== 'undefined' &&
  window.document &&
  window.document.createElement
);
@chenjiahan
Copy link
Owner

@Ajar-Ajar Thank you for your suggestion, This has been fixed in version 1.2.10, please try again.

@ajliv
Copy link
Contributor

ajliv commented Apr 21, 2016

Hey @chenjiahan, an upgrade to 1.2.10 still throws a "ReferenceError: window is not defined" for me during server-side render.

React v15 added onAnimationEnd support, which would remove the need for the animationEvents.js util I believe the error is still originating from, I submitted #5 to use this if you wanna consider it. :)

@chenjiahan
Copy link
Owner

@ajliv Thank you for your pull request 👍 This has been included in v1.3.0.

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