Having and issue registering my service worker using react typescript lcoalhost?

Viewed 13

I have the following regitrastion chain

export function register() {
  navigator.serviceWorker
    .register("./service-worker.ts")
    .then(() => console.log("Passed"))
    .catch((err) => alert("Reg Error"));
}

my current file structure looks like this enter image description here

and I am getting the following error

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

0 Answers
Related