Fixing zone-evergreen.js:659 Unhandled Promise rejection: Loading chunk # failed.

This error occurs when testing local PWA. For example you want to test behavior when you are offline.

Problem

Because you are offline (or pretending when testing) the PWA will search for offline assets. But you might have troubles running your PWA on localhost. To get the service worker to work correctly, check out this blogpost: https://stefvanlooveren.me/blog/getting-angular-pwa-service-worker-installed-localhost

Solution

Run the PWA on a local server to get the service workers to work correctly.

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!