diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts index d3a4238c76b1c6c7a2d291897c89c957ebe7d555..5728deffaf6d6c2f896aa5b7412505e22d8ede7c 100644 --- a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-typescript.ts @@ -231,7 +231,7 @@ export function etsTransform() { const hookEventFactory: CompileEvent = getHookEventFactory(this.share, 'etsTransform', 'afterBuildEnd'); const eventEtsTransformAfterBuildEnd = createAndStartEvent(hookEventFactory, 'etsTransformafterBuildEnd'); const harIntentDataObj: object = parseIntent.getHarData(); - if (parseIntent.intentData.length > 0 || parseIntent.isUpdateCompile || Object.keys(harIntentDataObj).length !== 0) { + if (parseIntent.intentData.length > 0 || parseIntent.isUpdateCompile || Object.keys(harIntentDataObj || {}).length !== 0) { parseIntent.writeUserIntentJsonFile(harIntentDataObj); } // Copy the cache files in the compileArkTS directory to the loader_out directory