From 034c7375ad2de4b42c0ac861c2dd18183511771d Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 31 Aug 2021 20:47:48 -0400 Subject: [PATCH] fix: handle case when there is no themeConfig --- src/shared/shared.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/shared.ts b/src/shared/shared.ts index bdfe89f64716..f42a0f966009 100644 --- a/src/shared/shared.ts +++ b/src/shared/shared.ts @@ -37,10 +37,10 @@ function resolveLocales( } export function createLangDictionary(siteData: { - themeConfig?: any + themeConfig?: Record locales?: Record }) { - const { locales } = siteData.themeConfig + const { locales } = siteData.themeConfig || {} const siteLocales = siteData.locales return locales && siteLocales ? Object.keys(locales).reduce((langs, path) => {