cache-polyfill icon indicating copy to clipboard operation
cache-polyfill copied to clipboard

ReferenceError: Cache is not defined

Open givingwu opened this issue 5 years ago • 4 comments

May u should merge this PR from @QingLeiLi to avoid this error.

(anonymous function)
internal:///Users/vuchan/Development/WorkSpace/***/node_modules/[email protected]@serviceworker-cache-polyfill/index.js:19
(function() {
> 19 |   var nativeAddAll = Cache.prototype.addAll;
  20 |   var userAgent = navigator.userAgent.match(/(Firefox|Chrome)\/(\d+\.)/);
  21 | 
  22 |   // Has nice behavior of `var` which everyone hates

givingwu avatar Aug 14 '18 02:08 givingwu

I tried his solution, but also got an error, it does not work.

this works:

if (window.Cache === undefined) return;

givingwu avatar Aug 14 '18 03:08 givingwu

@Vuchan Could you open a PR for it? Then I can close my bad one.

QingLeiLi avatar Aug 14 '18 03:08 QingLeiLi

@QingLeiLi well, I made this.

givingwu avatar Aug 14 '18 03:08 givingwu

Is this fixed?

burtontanner avatar Jun 06 '19 00:06 burtontanner