From 4386f3e64c61d67d10bdaa727232f64e339992ac Mon Sep 17 00:00:00 2001 From: shitao Date: Thu, 13 Mar 2025 20:50:48 +0800 Subject: [PATCH] In hotreload only modify non entry will crash Issue: IBT7W4 Signed-off-by: shitao Change-Id: I97f94f1b016fdfe22faa1d2c0d4403954642b705 --- .../ark_compiler/module/module_hotreload_mode.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts b/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts index a56654b20..f6275d1f8 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_hotreload_mode.ts @@ -129,6 +129,15 @@ export class ModuleHotreloadMode extends ModuleMode { return; } + // The process of '--remove-redundant-file' use filesInfos.txt and compileContextInfo.json to get compile list. + // In non first build hot reload, filesInfos.txt only contian modified files, could cause loss of compile list. + // When useNormalizedOHMUrl is true, project could import from bytecode har, it will cause crash. + // So recreate the entry list for compileContextInfo.json in non first build. + if (this.useNormalizedOHMUrl) { + this.projectConfig.entryObj = changedFileListInAbsolutePath; + this.compileContextInfoPath = this.generateCompileContextInfo(rollupObject); + } + const eventCollectModuleFileList = createAndStartEvent(parentEvent, 'collect module file list'); this.collectModuleFileList(rollupObject, changedFileListInAbsolutePath[Symbol.iterator]()); stopEvent(eventCollectModuleFileList); -- Gitee