diff --git a/utils/getLanguage.ts b/utils/getLanguage.ts index 632efce2..5b60fe38 100644 --- a/utils/getLanguage.ts +++ b/utils/getLanguage.ts @@ -107,7 +107,12 @@ function getLocale() { } async function loadLanguageFile(filePath: string): Promise { - return (await import(pathToFileURL(filePath).toString(), { with: { type: 'json' } })).default + return await fs.promises.readFile(filePath, 'utf-8').then((data) => { + const parsedData = JSON.parse(data) + if (parsedData) { + return parsedData + } + }) } export default async function getLanguage(localesRoot: string) {