diff --git a/packages/vite/src/index.ts b/packages/vite/src/index.ts index 236110e6..059751a8 100644 --- a/packages/vite/src/index.ts +++ b/packages/vite/src/index.ts @@ -94,6 +94,8 @@ export function imagetools(userOptions: Partial = {}): Plugin { const image = generatedImages.get(id) + if(!image) throw new Error(`vite-imagetools cannot find image with id "${id}" this is likely an internal error`) + if (pluginOptions.removeMetadata === false) { image.withMetadata() }