Firebase cloud messaging in Angular2

When resolving in an angular2 application, the following error appears. I am using the latest version of angular cli.

  The script has an unsupported MIME type ('text/html').
https://epush.in/firebase-messaging-sw.js Failed to load resource: net::ERR_INSECURE_RESPONSE
main.b757377….bundle.js:30496 permission An error occurred while retrieving token.  V {code: "messaging/failed-serviceworker-registration", message: "Messaging: We are unable to register the default s…). (messaging/failed-serviceworker-registration).", browserErrorMessage: "Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/html').", stack: "FirebaseError: Messaging: We are unable to registe…in/main.b7573773d12a16423658.bundle.js:1572:3907)"}
+4
source share
1 answer

If you download "/firebase-messaging-sw.js" to your browser, do you see a JavaScript file or something else? It looks like this url might return an HTML page (maybe 404 error)?

0
source

Source: https://habr.com/ru/post/1667988/


All Articles