diff --git a/.changeset/many-turtles-tie.md b/.changeset/many-turtles-tie.md new file mode 100644 index 000000000000..e98a6c5c75c0 --- /dev/null +++ b/.changeset/many-turtles-tie.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a missing error message when actions throws during `astro sync` diff --git a/packages/astro/src/core/logger/core.ts b/packages/astro/src/core/logger/core.ts index 530399ac4249..c06866df5c1d 100644 --- a/packages/astro/src/core/logger/core.ts +++ b/packages/astro/src/core/logger/core.ts @@ -27,6 +27,7 @@ export type LoggerLabel = | 'middleware' | 'preferences' | 'redirects' + | 'sync' | 'toolbar' | 'assets' | 'env' diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index 2a7aa83ce268..8b659a4f57be 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -61,7 +61,19 @@ export default async function sync( settings, logger, }); - await runHookConfigDone({ settings, logger }); + + // Run `astro:config:done` + // Actions will throw if there is misconfiguration, so catch here. + try { + await runHookConfigDone({ settings, logger }); + } catch(err) { + if(err instanceof Error) { + const errorMessage = err.toString(); + logger.error('sync', errorMessage); + } + throw err; + } + return await syncInternal({ settings, logger, fs, force: inlineConfig.force }); }