From 56e3402c81266c9340274cb3703df35e7533133f Mon Sep 17 00:00:00 2001 From: podar <1999688+podarsmarty@users.noreply.github.com> Date: Tue, 22 Jul 2025 00:08:17 -0500 Subject: [PATCH] [Bug] [QoL] Updating manifest fetching to be more resilient for local development and offline builds. (#4735) * Fixing local development and offline builds * Update src/main.ts --------- Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com> --- src/main.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 9063ac0ec5b..7e4943bdca5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -45,8 +45,10 @@ Phaser.GameObjects.Rectangle.prototype.setPositionRelative = setPositionRelative document.fonts.load("16px emerald").then(() => document.fonts.load("10px pkmnems")); // biome-ignore lint/suspicious/noImplicitAnyLet: TODO let game; +// biome-ignore lint/suspicious/noImplicitAnyLet: TODO +let manifest; -const startGame = async (manifest?: any) => { +const startGame = async () => { await initI18n(); const LoadingScene = (await import("./loading-scene")).LoadingScene; const BattleScene = (await import("./battle-scene")).BattleScene; @@ -110,10 +112,13 @@ const startGame = async (manifest?: any) => { fetch("/manifest.json") .then(res => res.json()) .then(jsonResponse => { - startGame(jsonResponse.manifest); + manifest = jsonResponse.manifest; }) - .catch(() => { - // Manifest not found (likely local build) + .catch(err => { + // Manifest not found (likely local build or path error on live) + console.log(`Manifest not found. ${err}`); + }) + .finally(() => { startGame(); });