Answers for "The script has an unsupported MIME type ('text/html'"

0

the script has an unsupported mime type (

app.get("/service-worker.js", (req, res) => {
  res.sendFile(path.resolve(__dirname, "public", "service-worker.js"));
});
app.get("*", function response(req, res) {
  res.sendFile(path.join(__dirname, "public", "index.html"));
});
Posted by: Guest on July-31-2021
0

The script has an unsupported MIME type ('text/html'

if you are using Workbox check were is instanced. 
if ('serviceWorker' in navigator) 
{
  console.log('Service Worker are supported.')              
  const wb = new Workbox('sw.js') // change 'sw.js' to '/sw.js'
}
Posted by: Guest on April-28-2022

Code answers related to "The script has an unsupported MIME type ('text/html'"

Browse Popular Code Answers by Language