diff --git a/packages/repack/src/modules/ScriptManager/ScriptManager.ts b/packages/repack/src/modules/ScriptManager/ScriptManager.ts index 8acaf0828..521678489 100644 --- a/packages/repack/src/modules/ScriptManager/ScriptManager.ts +++ b/packages/repack/src/modules/ScriptManager/ScriptManager.ts @@ -319,10 +319,12 @@ export class ScriptManager extends EventEmitter { const uniqueId = Script.getScriptUniqueId(scriptId, caller); if (this.scriptsPromises[uniqueId]) { const { isPrefetch } = this.scriptsPromises[uniqueId]; - await this.scriptsPromises[uniqueId]; + // prefetch is not execute the script so we need to run loadScript if promise is for prefetch - if (!isPrefetch) { - return Promise.resolve(); + if(isPrefetch){ + await this.scriptsPromises[uniqueId]; + }else{ + return this.scriptsPromises[uniqueId]; } } const loadProcess = async () => {