spark-html-manifest 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spark-html-manifest",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "PWA manifest + icons + offline app shell for spark-html sites from a single config — a spark-html-bun build step that generates manifest.webmanifest, resizes icons, injects the head tags, and optionally emits a minimal service worker.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -153,7 +153,10 @@ self.addEventListener('fetch', function (event) {
153
153
  var cachable = res && res.ok
154
154
  && ct.indexOf('text/event-stream') === -1
155
155
  && cc.indexOf('no-store') === -1;
156
- if (cachable) cache.put(req, res.clone());
156
+ // A navigation the user clicks away from is aborted mid-stream, so the
157
+ // cloned body errors and Cache.put() rejects with a NetworkError — a
158
+ // harmless race, but an unhandled rejection without this catch.
159
+ if (cachable) cache.put(req, res.clone()).catch(function () {});
157
160
  return res;
158
161
  }).catch(function () {
159
162
  if (cached) return cached;