diff --git a/src/app/HomePage.js b/src/app/HomePage.js index ab738e9..cbd2f0d 100644 --- a/src/app/HomePage.js +++ b/src/app/HomePage.js @@ -236,7 +236,11 @@ function SubmitPetForm() { // Start preloading the WardrobePage, too! // eslint-disable-next-line no-unused-expressions - import("./WardrobePage"); + import("./WardrobePage").catch((e) => { + // Let's just let this slide, because it's a preload error. Critical + // failures will happen elsewhere, and trigger reloads! + console.error(e); + }); }; const { brightBackground } = useCommonStyles(); diff --git a/src/app/util.js b/src/app/util.js index edab96e..0dff89a 100644 --- a/src/app/util.js +++ b/src/app/util.js @@ -326,8 +326,10 @@ export function loadable(load, options) { return loadableLibrary( () => load().catch((e) => { - console.error("Error loading page, reloading", e); + console.error("Error loading page, reloading:", e); window.location.reload(); + // Return a component that renders nothing, while we reload! + return () => null; }), options ); diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..7689ad6 --- /dev/null +++ b/vercel.json @@ -0,0 +1,11 @@ +{ + "routes": [ + { + "handle": "filesystem" + }, + { + "src": "/static/js/[^.]*\\.[^.]*\\.chunk.js", + "status": 404 + } + ] +}