Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/little-mice-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fix the `astro sync` error message when `getImage()` is called while loading content collections.
5 changes: 4 additions & 1 deletion packages/astro/src/assets/vite-plugin-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ export default function assets({ fs, settings, sync, logger }: Options): vite.Pl
export const getImage = async (options) => await getImageInternal(options, imageConfig);`
: `import { AstroError, AstroErrorData } from "astro/errors";
export const getImage = async () => {
throw new AstroError(AstroErrorData.GetImageNotUsedOnServer);
throw new AstroError(
AstroErrorData.GetImageNotUsedOnServer.message,
AstroErrorData.GetImageNotUsedOnServer.hint,
);
};`;

return {
Expand Down
Loading