0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: catch image errors correctly (#12695)

This commit is contained in:
Matt Kane 2024-12-09 15:10:17 +00:00 committed by GitHub
parent 2b53588772
commit a203d5dd58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Throws a more helpful error when images are missing

View file

@ -39,7 +39,7 @@ export function astroContentAssetPropagationPlugin({
? fileURLToPath(new URL(importerParam, settings.config.root)) ? fileURLToPath(new URL(importerParam, settings.config.root))
: importer; : importer;
const resolved = this.resolve(base, importerPath, { skipSelf: true, ...opts }); const resolved = await this.resolve(base, importerPath, { skipSelf: true, ...opts });
if (!resolved) { if (!resolved) {
throw new AstroError({ throw new AstroError({
...AstroErrorData.ImageNotFound, ...AstroErrorData.ImageNotFound,