How to force console logs to show in --prod mode


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?



npm run build --prod
npm install http-server -g
http-server ./www

Then, navigate to:


Calls to console.log() will appear in your browser’s console, for example:

platformBrowserDynamic().bootstrapModule(AppModule).then(() => {

  if ('serviceWorker' in navigator && ENV.production) {
    console.log('SW registered');

}).catch(error => console.log(error));

Chrome DevTools:


Thanks Rob for your prompt reply. I really appreciate it.