'Twilio push notifications with firebase error: unsupported MIME type ('text/html')

I am trying to integrate firebase with twilio for push notifications.

First of all I followed this guide on the twillio official site. They using an old version of firebase so I had to change the step 6 using this firebase guide and it says to add a firebase-messaging-sw.js file in the root of my domain before retrieving a token. But where exactly? I tried adding it everywhere, but it doesn't work.

The console prints me this error: enter image description here

I am using next.js with typescript.

Do you have any suggestion on how to fix this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source