So I am calling a firebase function through AngularFire like so:
const response = await this.aFunctions.httpsCallable<void, ResponseType>('funcName')().toPromise();
This works when deployed to firebase (hosting), but in the local environment (using ionic serve), it throws this error:
ERROR Error: Uncaught (in promise): FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:8100/firebase-cloud-messaging-push-scope') with script ('http://localhost:8100/firebase-messaging-sw.js'): A bad HTTP response code (404) was received when fetching the script. (messaging/failed-service-worker-registration).
FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:8100/firebase-cloud-messaging-push-scope') with script ('http://localhost:8100/firebase-messaging-sw.js'): A bad HTTP response code (404) was received when fetching the script. (messaging/failed-service-worker-registration).
I am not using FCM in any way in this project. Do you have any clue why this happens?