diff --git a/packages/preset-umi/src/features/mako/mako.ts b/packages/preset-umi/src/features/mako/mako.ts index 66e48700d716..f4c59ac9a17d 100644 --- a/packages/preset-umi/src/features/mako/mako.ts +++ b/packages/preset-umi/src/features/mako/mako.ts @@ -70,7 +70,7 @@ export default (api: IApi) => { generateEnd: ({ stats }: any) => { const entryPointFiles = new Set(); - for (const chunk of stats.entrypoints['umi'].chunks) { + for (const chunk of stats.entrypoints['umi']?.chunks || []) { const files = stats.chunks.find((c: any) => c.id === chunk).files; for (const file of files) { entryPointFiles.add(file);