Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda