I have a react-create-app application, in which I used firebase for pushnotification. Recently I upgraded firebase from 8.* to 9.*. While getting push token, it throws the following error:
FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('https://9fd5-49-204-137-92.ngrok.io/firebase-cloud-messaging-push-scope') with script ('https://9fd5-49-204-137-92.ngrok.io/firebase-messaging-sw.js'): The script has an unsupported MIME type ('text/html'). (messaging/failed-service-worker-registration).
In firebase.js, I have the following code set, which throws the above mentioned error