I'm trying to add files to the Cache storage in an angular 6 cli project but keep getting errors because of zonejs and I can't find out why. The code below works fine if I run in in a typescript project with no other code. The files are added to the cache so the function is executed but then it throws an error.
caches.open('assets').then((cache) => {
return cache.add('image.png');
});
If I run the same code in my angular project I get the error
Error: Uncaught (in promise): TypeError: the given value is not a Promise TypeError: the given value is not a Promise
See this Stackblitz to reproduce the error. When you click the sync button the given files are added to the cache storage and then the error is thrown.