From a203d5dd582166674c45e807a5dc9113e26e24f0 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Mon, 9 Dec 2024 15:10:17 +0000 Subject: [PATCH] fix: catch image errors correctly (#12695) --- .changeset/nine-experts-tan.md | 5 +++++ packages/astro/src/content/vite-plugin-content-assets.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/nine-experts-tan.md diff --git a/.changeset/nine-experts-tan.md b/.changeset/nine-experts-tan.md new file mode 100644 index 000000000000..86c8523442ef --- /dev/null +++ b/.changeset/nine-experts-tan.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Throws a more helpful error when images are missing diff --git a/packages/astro/src/content/vite-plugin-content-assets.ts b/packages/astro/src/content/vite-plugin-content-assets.ts index f4b8ed98ec70..33084d6e392e 100644 --- a/packages/astro/src/content/vite-plugin-content-assets.ts +++ b/packages/astro/src/content/vite-plugin-content-assets.ts @@ -39,7 +39,7 @@ export function astroContentAssetPropagationPlugin({ ? fileURLToPath(new URL(importerParam, settings.config.root)) : importer; - const resolved = this.resolve(base, importerPath, { skipSelf: true, ...opts }); + const resolved = await this.resolve(base, importerPath, { skipSelf: true, ...opts }); if (!resolved) { throw new AstroError({ ...AstroErrorData.ImageNotFound,