Fix for 'Waiting for the @astrojs/image integration' on Vercel
I tried to upload my Astro site to Vercel, but I kept getting an infinite "Waiting for the @astrojs/image integration..." message. I updated my Astro version, no help. Then I tried installing the @astrojs/vercel
package, no help, don't bother trying it as you don't need it unless you are using SSR instead of SSG.
Then I found out what the problem was: for some reason the Vercel build process does not support Astro's Avif image generation! I removed the Avif format from my picture components by adding formats={['jpg', 'webp']}
to them, which disables the automatic Avif generation.
<Picture formats={['jpg', 'webp']} // <---- This here fixed the builds src={import("../images/example.jpg")} aspectRatio={16/9} widths={[1200, 800, 600]} sizes="(min-width: 1200px) 1200px, 100vw" alt="Example"/>
Now, the Vercel build worked! I still got the same "Waiting for the @astrojs/image integration..." message, but this time it was followed by a "Completed" message. If you are using a png image, then use formats={['png', 'webp']}
instead.
So, if you are also having the infinite image integration message on Vercle, try removing Avif generation from your images. I hope this gets patched soon, though, as Avif images are very beneficial.