From e9b6141f16e4f7348aabe9b18f268cdc531844cd Mon Sep 17 00:00:00 2001 From: "Popper.Li" <519318459@qq.com> Date: Tue, 5 Sep 2023 13:10:40 +0800 Subject: [PATCH] fix: Error in generic type usage in internal checkDuplicatePluginKeys using reduce --- packages/preset-umi/src/features/tmpFiles/tmpFiles.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/preset-umi/src/features/tmpFiles/tmpFiles.ts b/packages/preset-umi/src/features/tmpFiles/tmpFiles.ts index 452114b7b357..cb7304114fbc 100644 --- a/packages/preset-umi/src/features/tmpFiles/tmpFiles.ts +++ b/packages/preset-umi/src/features/tmpFiles/tmpFiles.ts @@ -433,14 +433,14 @@ if (process.env.NODE_ENV === 'development') { function checkDuplicatePluginKeys(arr: string[]) { const duplicates: string[] = []; - arr.reduce((prev, curr) => { + arr.reduce<{ [k: string]: boolean }>((prev, curr) => { if (prev[curr]) { duplicates.push(curr); } else { prev[curr] = true; } return prev; - }, {} as { [k: string]: boolean }); + }, {}); if (duplicates.length) { throw new Error( `The plugin key cannot be duplicated. (${duplicates.join(', ')})`,