I got stuck for a while on an annoying error caused by my editing code and messing up promise syntax/parens. I eventually diagnosed it after finding this blog post, which motivated me to write up my own notes, however spare.
My experience was not as intricate as the blog post author's, except for this part:
At one point I accidentally wrote event.waitUntil(...).then(...). (The 'then' should go inside the brackets, not outside.) Firefox reported the error event.waitUntil(...) is undefined which is totally misleading and had me looking up the spec for waitUntil. Chrome had a better error: "cannot read property 'then' of undefined".
So that was a frustrating typo. Aside from dealing with promises, simple adding/registering of a service worker is quite simple and I like it -- all SW stuff self-contained in serviceworker.js
which is referenced only from the app js, since the SW is just JavaScript that runs separately from the DOM.
This