From 2bcea51a8b133872593ae25d69fbcb54a0836a4e Mon Sep 17 00:00:00 2001 From: Kuitos Date: Tue, 5 Mar 2024 20:55:22 +0800 Subject: [PATCH 1/2] fix(qiankun): should remove internal cache of loadMicroApp while loading failed --- packages/qiankun/src/apis/loadMicroApp.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/qiankun/src/apis/loadMicroApp.ts b/packages/qiankun/src/apis/loadMicroApp.ts index 26b075258..bb8b61fb2 100644 --- a/packages/qiankun/src/apis/loadMicroApp.ts +++ b/packages/qiankun/src/apis/loadMicroApp.ts @@ -71,12 +71,21 @@ export function loadMicroApp( const parcelConfigObjectGetterPromise = loadApp(app, userConfiguration, lifeCycles); + let parcelConfigObjectGetter: ParcelConfigObjectGetter | undefined; + if (containerXPath) { const appContainerXPathKey = getContainerXPathKey(containerXPath); appConfigPromiseGetterMap.set(appContainerXPathKey, parcelConfigObjectGetterPromise); + try { + parcelConfigObjectGetter = await parcelConfigObjectGetterPromise; + } catch (e) { + appConfigPromiseGetterMap.delete(appContainerXPathKey); + throw e; + } } - return (await parcelConfigObjectGetterPromise)(container); + parcelConfigObjectGetter = parcelConfigObjectGetter || (await parcelConfigObjectGetterPromise); + return parcelConfigObjectGetter(container); }; if (!started) { From 5aeded632c72574093adb6eee4f6c612888857bf Mon Sep 17 00:00:00 2001 From: Kuitos Date: Tue, 5 Mar 2024 20:58:40 +0800 Subject: [PATCH 2/2] Create poor-squids-hide.md --- .changeset/poor-squids-hide.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/poor-squids-hide.md diff --git a/.changeset/poor-squids-hide.md b/.changeset/poor-squids-hide.md new file mode 100644 index 000000000..26c73dbcc --- /dev/null +++ b/.changeset/poor-squids-hide.md @@ -0,0 +1,5 @@ +--- +"qiankun": patch +--- + +fix(qiankun): should remove internal cache of loadMicroApp while loading failed