Skip to content

Commit

Permalink
fix: catch image errors correctly (#12695)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Dec 9, 2024
1 parent 2b53588 commit a203d5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nine-experts-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Throws a more helpful error when images are missing
2 changes: 1 addition & 1 deletion packages/astro/src/content/vite-plugin-content-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a203d5d

Please sign in to comment.