issues running ngx-toastr in Server Side Render
See original GitHub issueHello, first of all, congratulations for your excellent work developing ngx-toastr.
The problem that I come to report is when I use the ngx-toastr module with Angularfire and Universal.
I made my application in Angular 6, I followed your instructions for installation and use. Everything works perfectly when I try the application with ng serve
. In the same way, everything works well with the application when I run ng build --prod
.
But my problem comes when I follow the steps to achieve the server side render with Angularfire and Universal.
I follow the steps described in:
https://github.com/angular/angularfire2/blob/dfaaac880d2829a893d471a2ee3811b79fcfaff3/docs/universal/getting-started.md
I get the application compile and run without errors BUT THE BEHAVIOR OF ngx-toastr RUNNING ON THE SERVER IS UNEXPECTED.
The first thing I saw is that the animations do not work in the same way as when I run the angular server with ng serve; but that is not important, that can be ignored; But WHAT I SEE AS A PROBLEM IS THAT SOME TOAST DOES NOT DISMISS BYPASSING THE TIMEOUT, NEITHER DISMISS WITH TAP ON THE TOAST TO DISMISS.
I have prepared a repository so that you can verify what I say:
https://github.com/IngAjVillalon/Angular-Universal-6-Server-Side-Render
The steps you must follow are:
Clone this repository
npm install
npm run build && npm run serve: ssr
You can see what I mentioned earlier.
Could you please help me to make ngx-toastr run well on the server side?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:8 (1 by maintainers)
Top GitHub Comments
Thanks for the repo and i’ll try to take a deeper look at it soon to see if we can do anything. I would avoid drawing toasts during route changes or on application init. You might also try number 1 in the FAQ https://github.com/scttcper/ngx-toastr#faq
What happens if you set
onActivateTick
to true when displaying the toasts from the server?