Service-Worker, “TypeError:Request failed at

前端 未结 3 1803
失恋的感觉
失恋的感觉 2021-02-20 03:41

I hope you can help me with my problem. Currently I build a PWA with a service-worker. It registerd successful, but something is wrong with the installation.

The \"cach

3条回答
  •  甜味超标
    2021-02-20 04:13

    This happened to me when I was developing locally on a windows machine and deploying on a linux server, the problem is with the path. You need to add a '.' before your path for it to be like "./" as follows:

    var resourcesToCache = [
    './',
    './index.html',
    './jquery-3.2.1.min.js',
    './pouchdb.min-6.4.1.js',
    './styles/inline.css',
    './scripts/app.js'
    

    ];

提交回复
热议问题