From f0a567b5eaf24a16c7f8c340626489e7285ab5e2 Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Sun, 18 Sep 2022 22:05:34 -0700 Subject: [PATCH] fix: log build errors in development mode (#232) Fixes #231 --- packages/build/src/build/impl/watch.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/build/src/build/impl/watch.ts b/packages/build/src/build/impl/watch.ts index 1254a73c..9b13adcf 100644 --- a/packages/build/src/build/impl/watch.ts +++ b/packages/build/src/build/impl/watch.ts @@ -52,7 +52,15 @@ export function watch(config: ResolvedConfig, userConfig: UserConfig, plugins: P abortSignal: currentBuildState.abortController.signal } buildOnce(config, userConfig, plugins, buildOptions) + .then(result => { + // Log the error message in case of error result + if (result.isErr()) { + logError(result.error) + } + }) .catch(e => { + // Also catch thrown errors that may have not already been + // handled by `buildOnce` logError(e) // log('info', 'Waiting for changes...') })