create-kide-app 0.0.23 → 0.0.24

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kide-app",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "Scaffold a new Kide CMS project",
5
5
  "author": "Matti Hernesniemi",
6
6
  "license": "MIT",
@@ -20,10 +20,12 @@ if (new URLSearchParams(location.search).has("preview")) {
20
20
  headers: { "Content-Type": "application/json" },
21
21
  body: JSON.stringify({ type: d.render, data: d.value }),
22
22
  })
23
- .then((r) => r.text())
23
+ .then((r) => (r.ok ? r.text() : null))
24
24
  .then((html) => {
25
- if (id === pending) els.forEach((el) => (el.innerHTML = html));
26
- });
25
+ // Endpoint may not exist in production builds (only dev) silently skip
26
+ if (html != null && id === pending) els.forEach((el) => (el.innerHTML = html));
27
+ })
28
+ .catch(() => {});
27
29
  } else if (d.html != null) {
28
30
  els.forEach((el) => (el.innerHTML = d.html));
29
31
  } else {