question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ServiceWorker fetch failed (ERR_NAME_NOT_RESOLVED)

See original GitHub issue

Installing serviceworker using following code fails with ERR_NAME_NOT_RESOLVED I am able to load sw.js file using ajax and via script tag just fine

navigator.serviceWorker.register('sw.js').then(function(registration) {
  console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
  console.log('ServiceWorker registration failed: ', err);
});

The result is

An unknown error occurred when fetching the script.
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
ServiceWorker registration failed:  TypeError: Failed to register a ServiceWorker: An unknown error occurred when fetching the script.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
pavelfeldmancommented, Nov 1, 2018

Got it, thanks for confirming. We would want to make sure any web content loads in Carlo, so your SW request stands as a bug report.

0reactions
jamesb3llcommented, Nov 2, 2018

Web Push support (GCM) from Service Worker pushManager would be great as electron doesn’t support it: https://github.com/electron/electron/issues/6697

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service Worker Fetch Error When Trying to Load --- My ...
I am not getting a failed fetch in Network Tab but an Error Message in the console. Maybe you can take a look...
Read more >
ERR_NAME_NOT_RESOLVED: 6 Proven Methods to Fix It
This article will explain what it is, why this error occurs, and six effective methods to resolve it. Error code, ERR_NAME_NOT_RESOLVED. Error type,...
Read more >
Service Workers - When Fetch Goes Wrong - YouTube
This is the seventh video in the Understanding Service Workers course.This video explains how you can use your Service Worker to handle an ......
Read more >
ERR_NAME_NOT_RESOLVED: 6 Ways to Fix It
This article features several guides that will help you fix this error. err name not resolved. The ERR_NAME_NOT_RESOLVED Google Chrome error ...
Read more >
FetchEvent.respondWith() - Web APIs - MDN Web Docs
This means, for example, if a service worker intercepts a stylesheet or worker script, ... Otherwise, a network error is returned to Fetch....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found