Tengo una aplicación de reacción e intento agregarle la funcionalidad PWA, agregué manifest.json en la carpeta pública y serviceWorker.js en la carpeta src.
Cuando implemento la aplicación en netlify, aparece un error al verificar el archivo de manifiesto en las herramientas de desarrollo de Chrome en la sección de la aplicación.
No matching service worker detected. You may need to reload the page, or check that the scope of the service worker for the current page encloses the scope and start URL from the manifest.
Mi manifiesto.json
{ "theme_color": "#f493cf", "background_color": "#f6f6f6", "display": "standalone", "scope": "/", "start_url": "/", "name": "Emily tasks", "short_name": "Emily tasks", "description": "Emily taks", "icons": [ { "src": "/icon-192x192.png", "sizes": "192x192", "type": "image/png" }, { "src": "/icon-256x256.png", "sizes": "256x256", "type": "image/png" }, { "src": "/icon-384x384.png", "sizes": "384x384", "type": "image/png" }, { "src": "/icon-512x512.png", "sizes": "512x512", "type": "image/png" } ] }y en index.js en la carpeta src, importé serviceWorker y llamé a su función register().
`importar * como trabajador de servicio desde './trabajador de servicio';
trabajadorservicio.registrar();
Actualmente, el archivo serviceWorker.js es estándar como cuando se creó cuando hice la aplicación CRA.
Mi estructura de carpetas actual es la siguiente
-node_modules -public --index.html --manifest.json -src --index.js --serviceWorker.js -package.json