The script has an unsupported MIME type ('text/html'). DOMException: Failed to register a ServiceWorker
See original GitHub issueIssue 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
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.
- Installed packages: “@axa-fr/react-oidc-context”: “^4.2.8”, “react”: “17.0.2”, “react-dom”: “17.0.2”
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (12 by maintainers)
Top GitHub Comments
Thank you for your feeback 😃
it was merge on main branch => https://github.com/AxaGuilDEv/ml-cli/blob/master/src/Ml.Cli.WebApp/ClientApp/public/web.config
😃