Everything was working fine with my Service Worker project, but suddenly I am seeing the following error:
Uncaught (in promise) DOMException: Failed to register
So it turns out this just indicates there is a JS error in the Service Worker code itself, so the registration couldn't complete.
Load chrome://serviceworker-internals/ and check 'Open DevTools window and pause JavaScript execution on Service Worker startup for debugging.'
The inspector will then pop up when you refresh the page, allowing you to see the error in the Service Worker.