angular-university / angular-pwa-course

Angular PWA Course - Build Progressive Web Applications
https://angular-university.io/course/angular-pwa-course
MIT License
182 stars 129 forks source link

'*.bundle.jsBranch' files in '2-download-and-install' not created #11

Open lin-brian-l opened 5 years ago

lin-brian-l commented 5 years ago

Hello,

I'm attempting to follow along with the section of the tutorial for downloading an application in the background, but when using using npm run server on one terminal window and npm start on another, I get errors in the Chrome console about failed requests and my cache storage is empty unless I don't include the bundled files. Can someone look into why this is occurring?

Also, it's worth noting that after I pulled the 2-download-and-install branch, I was getting errors when attempting to register the service worker because src/sw.js was not included in the assets array of the angular.json file.

EDIT: From my understanding, *.bundle files are no longer created by newer versions of the angular-cli. Can the sw.js file be updated to reflect the correct files?

EDIT2: When I was attempting the next lesson (Using Service Workers To Implement a Cache Then Network Fetch Strategy), taking the page offline and then refreshing would cause the page to crash instead of loading without the courses content. I was able to resolve this by adding the /runtime.js file to the cache, which was not described in the video; can this be added to sw.js?