You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a service worker. The code works, but for some reason yuicompressor is not minifing the code, because of caches.delete();
My code
self.addEventListener('activate', function (e) {
// console.log("service worker has been activated");
e.waitUntil(caches.keys().then(function (cacheNames) {
return Promise.all(cacheNames.filter(function (key) {
return key !== staticCache;
}).map(function (key) {
return caches.delete(key); // error occurs here
}));
}));
});
Yuicompressor error
"D:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\jbr/bin/java" -jar D:\xampp\htdocs\portfolio-thom\node_modules\yuicompressor\build\yuicompressor-2.4.8.jar sw.js -v -o sw.min.js
[INFO] Using charset UTF-8
[ERROR] in sw.js
36:34:missing name after . operator
[ERROR] in sw.js
1:0:Compilation produced 1 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 1 syntax errors.
at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:172)
at org.mozilla.javascript.Parser.parse(Parser.java:396)
at org.mozilla.javascript.Parser.parse(Parser.java:340)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:315)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:536)
at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:147)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
Process finished with exit code 2
The text was updated successfully, but these errors were encountered:
I am building a service worker. The code works, but for some reason yuicompressor is not minifing the code, because of caches.delete();
My code
Yuicompressor error
The text was updated successfully, but these errors were encountered: