Service Worker registration error: Unsupported MIME type (‘text/html’)

Applying this change:

'/service-worker.js'  // ❌
'./service-worker.js' // ✅

fixed my issue.

(in navigator.serviceWorker.register('/service-worker.js'))


Or maybe you need:

'%PUBLIC_URL%/serviceworker.js'

Thank @DanielLord for his comment.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)