Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
PWA: Service worker issues

Hi I have been trying to learn PWA and is having a problem with service workers, basically when I try to audit through lighthouse I get the following error:

Service Worker not registered: Failed to register a ServiceWorker for scope ('http://127.0.0.1:5500/') with script ('http://127.0.0.1:5500/sw.js')

Though when I start the app it says it has been activated and is running under the Application tab in devtools. The information I log to the console also show it as registered.

Edit: I'm logging the following information to the console if it helps.

ServiceWorkerRegistration
active: ServiceWorker {scriptURL: 'http://127.0.0.1:5500/sw.js', 
state: 'activated', onstatechange: null, onerror: null}
backgroundFetch: BackgroundFetchManager {}
cookies: CookieStoreManager {}
installing: null
navigationPreload: NavigationPreloadManager {}
onupdatefound: null
paymentManager: PaymentManager {instruments: PaymentInstruments, 
 userHint: ''}
periodicSync: PeriodicSyncManager {}
pushManager: PushManager {}
scope: "http://127.0.0.1:5500/"
sync: SyncManager {}
updateViaCache: "imports"
waiting: null
[[Prototype]]: ServiceWorkerRegistration

Also the I register the service worker in a file name app.js like this:

if('serviceWorker' in navigator) {
     navigator.serviceWorker.register('/sw.js')
        .then((reg) => console.log('Service Worker registered.', reg))
        .catch((err) => console.log('Service Worker not registered.', err));
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda