-
Notifications
You must be signed in to change notification settings - Fork 154
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
Support for server side pre-rendering #82
Comments
This makes sense. Can you please send a PR for that? Also, please see #74 |
I started working on this, but I'm having a hard time trying it out. I've tried to npm link it, but then the server side pre-rendering fails entirely with the same error message that is mentioned in #68. Any thoughts on that? |
How did you import the module? Please see my last comment on #81 |
I've tried both:
and:
But I'm getting the same error in both cases? |
Can you please check with the latest beta, |
I merged my forks master with your master and then tried to npm link again, but I'm still getting the same error message. I noticed that both the TimeAgoPipe and CalendarPipe now use ngZone.runOutsideAngular(), but it looks like that is still being executed during server side pre-rendering so it doesn't fix this issue. I guess we'll have to check for the existence of window explicitly. Want to try that out locally first though. |
I ended up just modifying the copy of this module inside the node_modules folder in order to verify if it works as expected. |
I've been working on an Angular 2 app with an ASP.NET Core backend that uses server side pre-rendering. Unfortunately I found out that using these pipes breaks the server side rendering.
This mostly seems to be because they use window.setTimeout and window.clearTimeout, but window isn't available during the server side rendering for obvious reasons. Is there something we can do here to make this play nice with server side pre-rendering? Perhaps checking if window is defined would be enough?
The text was updated successfully, but these errors were encountered: