O registro do SW falhou com TypeError: o script ServiceWorker em http://localhost/Vanilla/CacheManager.js para o escopo http://localhost/Vanilla/ gerou uma exceção durante a avaliação do script.
Estou recebendo o TypeError acima ao tentar registrar um ServiceWorker com o FireFox (funciona no Chrome, WSdge, Opera) -
if ("serviceWorker" in navigator) {
await navigator.serviceWorker.register('/Vanilla/CacheManager.js', { scope: '/Vanilla/', type: 'module' })
.then(reg => {
console.log('SW Registered');
})
.catch(err => {
console.log('SW Registration failed with ' + err)
});
CacheManager.js (reduzido para) -
*import config from "/Vanilla/config.js"* **// The problem**
console.log("Hello")
//const CACHE_NAME = config.cacheName
Configuração.js
export const config =
{
"cacheName": "VanillaV1.1"
}
Não tenho ideia do que o TypeError FireFox está reclamando. CONST?