In order to debug the “white screen of death”, I need a way to see the console logs in --prod mode.
Remote debugging is useless since nothing is sent to the console.
Is there a way to keep the logs in --prod mode?
Try:
npm run build --prod
npm install http-server -g
http-server ./www
Then, navigate to:
http://localhost:8100
Calls to console.log() will appear in your browser’s console, for example:
platformBrowserDynamic().bootstrapModule(AppModule).then(() => {
if ('serviceWorker' in navigator && ENV.production) {
navigator.serviceWorker.register('/ngsw-worker.js');
console.log('SW registered');
}
}).catch(error => console.log(error));
Chrome DevTools:
Thanks Rob for your prompt reply. I really appreciate it.