Open trackx2k17 opened 7 years ago
@trackx2k17
if (typeof(window) !== 'undefined') {
this._toastyService.error({
title: 'Error',
msg: 'An unexpected error happened.',
showClose: true,
timeout: 5000,
theme: 'bootstrap'
});
}
Hi,
I got an error during server side prerending
Exception: Call to Node module failed with error: ReferenceError: window is not defined at ToastyComponent._setTimeout
`import {ErrorHandler, Inject, NgZone} from "@angular/core"; import {ToastyService} from "ng2-toasty";
export class AppErrorHandler implements ErrorHandler {
}`
if i use direcly toasty inside a compononent without the error handler class.... the prereding works well i can refresh the page without any problem.... only during the prerending using the error handler class
Any idea how to fix that
Thanks in advance