After deploy my angular 7 project (PWA) got this error. any solution?
Uncaught (in promise) Error: Manifest fetch failed! (status: 404) at Driver. (ngsw-worker.js:2368) at Generator.next () at fulfilled (ngsw-worker.js:1780)
Progressive Web Application considers service workers as the primary technology. It allows deep platform integration, such as offline support, background sync, rich caching, and push notifications. The “ng add angular pwa” command generated the ngsw-config.json file, It is solely responsible for service workers.
If a particular file fails validation, the Angular service worker attempts to re-fetch the content using a "cache-busting" URL parameter to eliminate the effects of browser or intermediate caching.
From time to time, the service worker will be updated with bug fixes and feature improvements. The Angular service worker is downloaded when the app is first opened and when the app is accessed after a period of inactivity. If the service worker has changed, the service worker will be updated in the background.
An unrelated error causes the service worker to enter safe mode; that is, temporary deactivation. The Angular service worker is aware of which versions are in use at any given moment and it cleans up versions when no tab is using them. Other reasons the Angular service worker might change the version of a running application are normal events:
I had the same problem and I found the solution here.
If you upload a
.json
file to your Windows Azure website and try to access it, it would give you a404 File Not Found
error because the MIME Type of.json
is not set by default. This also applies in general to any file that might need a specific MIME Type.To fix this issue, FTP into your website and upload the following
Web.config
file which will set the correct MIME types. If you already have aWeb.config
file in place, just add the below to the appropriate section.
Web.config:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</configuration>
I had a similar issue...
Failed to load manifest.webmanifest . A ServiceWorker passed a promise to FetchEvent.respondWith() that resolved with non-Response value ‘undefined’.
My manifest name was manifest.webmanifest
and I had added some filters to my service worker to serve static files only.
Because of .webmanifest
extension, it didn't recognize as static content and when the client is offline it failed to serve from cache.
I solved this issue by simply renaming it to manifest.json
.
Hope this prevents someone's headache... :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With