From c17ce34a27e57b0d05c9701085d88a6e367ff7a3 Mon Sep 17 00:00:00 2001 From: Bread Grocery Date: Mon, 28 Oct 2024 21:43:21 +0800 Subject: [PATCH] fix: Prevent app crashes from parse errors due to incomplete file saves (#1114) --- packages/i18n/src/module.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/i18n/src/module.ts b/packages/i18n/src/module.ts index d097e553..fdf9f29b 100644 --- a/packages/i18n/src/module.ts +++ b/packages/i18n/src/module.ts @@ -158,7 +158,9 @@ export { type GeneratedI18nStructure } if (wxt.config.command === 'serve') { wxt.hooks.hookOnce('build:done', () => { const watcher = watch(localesDir); - watcher.on('change', updateLocalizations); + watcher.on('change', (path) => { + updateLocalizations(path).catch(wxt.logger.error); + }); }); } },