-
Notifications
You must be signed in to change notification settings - Fork 502
Description
Below is the error which I received.
TypeError: Failed to register a ServiceWorker for scope ('http://localhost:9000/') with script ('http://localhost:9000/serviceWorker.js'): A bad HTTP response code (404) was received when fetching the script.
Below are the script added in index.html and serviceWorker.js is added at same location.
for now I kept serviceWorker.js empty
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('serviceWorker.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>