admin 管理员组文章数量: 1086019
SW Registration failed with TypeError: ServiceWorker script at http://localhost/Vanilla/CacheManager.js for scope http://localhost/Vanilla/ threw an exception during script evaluation.
I'm getting the above TypeError when trying to register a ServiceWorker with FireFox (Works on 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 (reduced to) -
*import config from "/Vanilla/config.js"* **// The problem**
console.log("Hello")
//const CACHE_NAME = config.cacheName
Config.js
export const config =
{
"cacheName": "VanillaV1.1"
}
I have no idea what TypeError FireFox is complaining about. CONST?
SW Registration failed with TypeError: ServiceWorker script at http://localhost/Vanilla/CacheManager.js for scope http://localhost/Vanilla/ threw an exception during script evaluation.
I'm getting the above TypeError when trying to register a ServiceWorker with FireFox (Works on 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 (reduced to) -
*import config from "/Vanilla/config.js"* **// The problem**
console.log("Hello")
//const CACHE_NAME = config.cacheName
Config.js
export const config =
{
"cacheName": "VanillaV1.1"
}
I have no idea what TypeError FireFox is complaining about. CONST?
Share Improve this question asked Mar 30 at 0:57 McMurphyMcMurphy 1,3061 gold badge17 silver badges51 bronze badges1 Answer
Reset to default 0Firefox doesn't support module ServiceWorker
s, yet. Here's the issue Implement "module" service workers.
本文标签: javascriptFirefox Service Worker import module giving TypeErrorStack Overflow
版权声明:本文标题:javascript - Firefox Service Worker import module giving TypeError - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1743999721a2516222.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论