I am getting this error, The script has an unsupported MIME type ('text/html'). Unable to resolve using firebase-messaging-sw.js.
const messaging = firebase.messaging();
messaging.requestPermission().then(function(){ console.log("have permission");
return messaging.getToken(); }).then(function(token){
console.log(token)
}).catch(function(err){
console.log("Error");
})