diff --git a/tools/isobuild/bundler.js b/tools/isobuild/bundler.js index 415b4c65e2..2f63938616 100644 --- a/tools/isobuild/bundler.js +++ b/tools/isobuild/bundler.js @@ -3295,17 +3295,13 @@ async function bundle({ buildMode: buildOptions.buildMode }); - try { - await client.make({ - packages: [app], - minifyMode: minifyMode, - minifiers: options.minifiers || [], - addCacheBusters: true, - onJsOutputFiles, - }); - } catch (e) { - // it's fine to fail here, but we don't want to propagate the error - } + await client.make({ + packages: [app], + minifyMode: minifyMode, + minifiers: options.minifiers || [], + addCacheBusters: true, + onJsOutputFiles, + }); return client; }); diff --git a/tools/runners/run-app.js b/tools/runners/run-app.js index d00ab78308..6bbed38ec9 100644 --- a/tools/runners/run-app.js +++ b/tools/runners/run-app.js @@ -405,7 +405,15 @@ Object.assign(AppRunner.prototype, { self.isRunning = true; global.asyncLocalStorage.run({}, () => - self._runApp().catch((e) => self._resolvePromise("start", e)) + self._runApp() + .catch((e) => { + // There was an unexpected error when building the app + // This is not recoverable, so we turn it into an unhandled exception + // and crash. + setTimeout(() => { + throw e; + }); + }) ); await self.startPromise; self.startPromise = null; @@ -435,9 +443,6 @@ Object.assign(AppRunner.prototype, { ee.emit(name, value); this._promiseResolvers[name] = null; } - if (value instanceof Error) { - throw value; - } }, _cleanUpPromises: function () {