From 7aca33a1c4c9f6a7861041a5902052d36539ebbf Mon Sep 17 00:00:00 2001 From: KPal Date: Thu, 9 Jul 2026 14:25:19 +0100 Subject: [PATCH] fix(launch): skip script concatenation for projects with esm scripts Concatenation is a classic-scripts-only backend feature. Enabling it for a project that contains esm (.mjs) scripts makes the concatenated-scripts endpoint time out (504), so the engine preload blocks on the request and the launcher never finishes loading. Guard concatenateScripts=true at its only source so it is not requested when the project has any esm script. --- src/editor/viewport-controls/viewport-launch.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor/viewport-controls/viewport-launch.ts b/src/editor/viewport-controls/viewport-launch.ts index d4a6ce1e6..934a47dfc 100644 --- a/src/editor/viewport-controls/viewport-launch.ts +++ b/src/editor/viewport-controls/viewport-launch.ts @@ -81,7 +81,10 @@ editor.once('load', () => { query.push('debug=true'); } - if (launchOptions.concatenate) { + // concatenation is a classic-scripts-only backend feature; the concatenated-scripts + // endpoint times out (504) for projects containing esm (.mjs) scripts, which hangs the + // launcher, so skip it when any esm script is present + if (launchOptions.concatenate && !editor.call('assets:list').some(a => editor.call('assets:isModule', a))) { query.push('concatenateScripts=true'); }