Service Worker error. Not working on live(https) server

廉价感情. 提交于 2019-12-06 16:01:39

A Service Worker script has to be served using a JavaScript media type i.e. either of text/javascript, application/javascript or application/x-javascript.

It can be wrong path to your Service Worker.

ServiceWorker supported MIME type are 'text/javascript', application/javascript and application/x-javascript. got to ur server file and set

response.writeHead(201, {
    'Content-Type': 'application/javascript'
});

Thanks for your time and efforts.I am finally able to solve the problem. The problem occur because i use .htaccess to modify my url. At modified url main.js is not able to load the sw.js.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!