From 0ba1b2631894a066bcf7e14019a7fa274b2aa916 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sun, 14 Apr 2024 21:28:26 +0200 Subject: [PATCH] Fixed sync-i18n script not working anymore This is caused by the typescript 4.4 update that changed the catch type from any to unknown --- scripts/sync-i18n-files.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/sync-i18n-files.ts b/scripts/sync-i18n-files.ts index 96ba0d4010..170266b6a2 100644 --- a/scripts/sync-i18n-files.ts +++ b/scripts/sync-i18n-files.ts @@ -275,7 +275,9 @@ function readFileIfExists(pathToFile) { try { return fs.readFileSync(pathToFile, 'utf8'); } catch (e) { - console.error('Error:', e.stack); + if (e instanceof Error) { + console.error('Error:', e.stack); + } } } return null;