question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The script has an unsupported MIME type ('text/html'). DOMException: Failed to register a ServiceWorker

See original GitHub issue

Issue and Steps to Reproduce

When loading framework libraries “The script has an unsupported MIME type (‘text/html’).” is written to console.

When accessing <OidcSecure> protected React component error happen. And page is displayed: “Authentification erreur Une erreur est survenu lors de l’authentification”

This happens only if I’m using:

  service_worker_relative_url:'/helpers/authentication/OidcServiceWorker.js',
  service_worker_only:true

in oidcConfiguration. Without ServiceWorker everything is fine.

I want to use service worker as a event entry point after login/silentLogin to update user context with name of logged user. (i dont want to create authentication/callback page and do it there)

Versions

4.2.8

Screenshots

Screenshot 2022-03-06 at 18 50 38

Expected

Redirect to oidc authentication endpoint.

Actual

Error is displayed.

Additional Details

Has anyone run into this issue since migration v3 -> v4? I’ve done all steps according to the manual. And I’m getting this error.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
guillaume-chervetcommented, Mar 10, 2022

Thank you for your feeback 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service Worker registration error: Unsupported MIME type ...
Error during service worker registration: DOMException: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/html ...
Read more >
Error: Service worker has an unsupported MIME type ('text ...
by the way, the mime type error happens before the service worker has a chance to register (or even load its module code)...
Read more >
The script has an unsupported MIME type ('text/html')
I get following error: The script has an unsupported MIME type ('text/html'). service worker error DOMException: Failed to register a ...
Read more >
ServiceWorker MIME Type Error ('text/html') on register (React)
DOMException : Failed to register a ServiceWorker for scope ('http://localhost:3000/') with script ... The script has an unsupported MIME type ('text/html').
Read more >
Javascript Error Thrown – OneSignal Issues | WordPress.org
... DOMException: Failed to update a ServiceWorker for scope with script ('OneSignalSDKWorker.js.php'): The script has an unsupported MIME type ('text/html').
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found