problem
ERROR Error: Uncaught (in promise): Error: Loading chunk dashboard.module failed.
Error: Loading chunk dashboard.module failed.
i would like use this
import { Injectable, ErrorHandler } from "@angular/core";
@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
handleError(err: any): void {
const chunkFailedMessage = /Loading chunk [\d]+ failed/;
const chunkFailedMessage1 = /Loading chunk dashboard.module failed/;
console.log('Loading chunk FRT'+ err);
console.log('Loading chunk FRT'+ err.message);
if (chunkFailedMessage1.test(err.message)) {
alert("Se requiere un reinicio para el correcto funcionamiento del sitio");
window.location.reload();
}
}
}
i have in my proyect app.modules.ts --> pages.module.ts --> Child (module who should lauch ErrorHandler)
In your module, you should register
GlobalErrorHandler
in providers as below,