From d178b4dbaf99df970541d52740edf40f64be5b2d Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Fri, 9 May 2025 14:08:50 +0200 Subject: [PATCH] devops: fix crash in build.js watch mode with SyntaxError (#35904) --- utils/build/build.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/build/build.js b/utils/build/build.js index 6be007a2ba..2d4e856e0c 100644 --- a/utils/build/build.js +++ b/utils/build/build.js @@ -287,7 +287,7 @@ class EsbuildStep extends Step { if (watchMode) { await this._ensureWatching(); } else { - console.log('==== Running esbuild', this._options.entryPoints); + console.log('==== Running esbuild', this._options.entryPoints.map(e => path.relative(ROOT, e)).join(', ')); const start = Date.now(); await build(this._options); console.log('==== Done in', Date.now() - start, 'ms'); @@ -316,7 +316,13 @@ class EsbuildStep extends Step { do { this._sourcesChanged = false; this._rebuilding = true; - await this._context?.rebuild(); + try { + await this._context?.rebuild(); + } catch (e) { + + console.error('Rebuild failed:', e); + } + this._rebuilding = false; } while (this._sourcesChanged); }