From 2b5939ab7e9686d8df3da52c7f431c55e193af6d Mon Sep 17 00:00:00 2001 From: zhouzw8 Date: Tue, 13 May 2025 15:36:33 +0800 Subject: [PATCH] fix: should dispatch error event when mount error --- src/create_app.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/create_app.ts b/src/create_app.ts index 3803d47c..c46115cc 100644 --- a/src/create_app.ts +++ b/src/create_app.ts @@ -336,6 +336,7 @@ export default class CreateApp implements AppInterface { } } catch (e) { logError('An error occurred when mount \n', this.name, e) + this.onerror(e) } } } @@ -353,6 +354,7 @@ export default class CreateApp implements AppInterface { this.handleMounted(this.umdHookMount!(microApp.getData(this.name, true))) } catch (e) { logError('An error occurred when mount \n', this.name, e) + this.onerror(e) } } } @@ -383,6 +385,8 @@ export default class CreateApp implements AppInterface { .then(nextAction) .catch((e) => { logError('An error occurred in window.mount \n', this.name, e) + this.onerror(e) + // TODO: 为什么 error 还要继续 nextAction? nextAction() }) } else {