Error: Messaging: We are unable to register the default service worker

Viewed 2564

My Flutter app on web has been using Firebase Cloud Messaging for a long time without error. Today, with no changes, it is giving the following error:

Error: [firebase_messaging/failed-service-worker-registration] Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:50093/firebase-cloud-messaging-push-scope') with script ('http://localhost:50093/firebase-messaging-sw.js'): The Service Worker system has shutdown.

Can anyone explain why this error is occurring now? I suspect something must have changed on Firebase's end, because my code has not changed.

1 Answers

If you're using an older version of Firebase Cloud Messaging plugin, you might need to follow this setup guide to create a default app settings for web. On current version of FCM, you can follow this initialization guide to add the FCM plugin on your app.

Related