From e2e6a8b3ade4ce99d0e5a77186af69f4cfd5b6f0 Mon Sep 17 00:00:00 2001 From: Joery <44531907+Joery-M@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:20:54 +0100 Subject: [PATCH] fix(localization): :rotating_light: Fixed error that (i think) came from the i18n generation timing out --- .../safelight/buildscripts/vite-plugin-generate-i18n.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts b/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts index 067e439..9705749 100644 --- a/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts +++ b/packages/safelight/buildscripts/vite-plugin-generate-i18n.ts @@ -39,7 +39,11 @@ interface Options { async function compileTypes({ localesDir: dir, outputFile: output }: Options) { const files = await glob(dir + '/*.json', { signal: AbortSignal.timeout(1000) + }).catch((err) => { + console.error('Could not find i18n files:', err); + return [] as string[]; }); + if (!files.length) return; // Combine all files into 1 object const allFiles: Record = {}; @@ -94,7 +98,9 @@ declare module 'vue-i18n' { outputFile = outputFile.replace(/((? + console.error('Error writing i18n definitions:', err) + ); } // Source: https://stackoverflow.com/a/34749873