-
Notifications
You must be signed in to change notification settings - Fork 145
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
ngOnDestroy throws error when in SSR #163
Comments
I would be more than happy to to add this capability, though I am not sure what is missed. Can you post some demo project for me to starting on? |
I have a similar Problem. The quick and dirty solutuion would be to modify the code this way:
|
I got same error in my application.
this is my main code
when the app first load, and run method |
The component wasn't built for SSR (yet) I will be glad for a PR. |
@Hampfter, why is your solution considered dirty? The problem is with Solution example: |
resolved in c2a0c8b |
Hey, first of all thanks a lot for your work! It's great!
Could you please provide SSR (universal) support?
I faced with next:
TypeError: Cannot read property 'removeChild' of undefined at DatePickerComponent.ngOnDestroy (webpack-internal:///77:272:29) at callProviderLifecycles (webpack-internal:///2:11392:18) at callElementProvidersLifecycles (webpack-internal:///2:11361:13) at callLifecycleHooksChildrenFirst (webpack-internal:///2:11345:17) at destroyView (webpack-internal:///2:12681:5) at callViewAction (webpack-internal:///2:12827:13) at execComponentViewsAction (webpack-internal:///2:12739:13) at destroyView (webpack-internal:///2:12680:5) at callViewAction (webpack-internal:///2:12827:13) at execComponentViewsAction (webpack-internal:///2:12739:13)
Looks like this happened because server try to execute 'removeChild' of nothing.
I resolved this by checking isPlatformBrowser(this.platformId) and render datepicker only in browser and all works, but yeah, when i get html from the server side, there is no datepicker and i can't see it on browser until browser bundle render datepicker. So there is some delay between getting page html and datepicker.
Probably this is not a big issue because this happens only if user go to page directly by ulr link, but SSR support would be a good investment.
Thanks
The text was updated successfully, but these errors were encountered: