#Anyone having a good <Image /> working with Vercel ?

2 messages · Page 1 of 1 (latest)

warm imp
#

Hi !

I am trying to get <Image /> component fully working with Vercel. Currently it does the job (as it compress images).

However, it's impossible for me to obtain any srcset. Here is the rendered HTML for an image :

<img src="/_vercel/image?url=https%3A%2F%2Fa.storyblok.com%2Ff%2F251117%2F1200x600%2F668ce2e67d%2Fstrapi-cms.png&amp;w=1200&amp;q=100" alt="Image de présentation du CMS Strapi avec le logo" class="rounded-2xl shadow-2xl object-cover h-full w-full" width="1200" height="600" loading="lazy" decoding="async">

I think everything is well configured ...

ASTRO / VERCEL CONFIG

import vercel from '@astrojs/vercel/serverless';

  adapter: vercel({
    imageService: true,
    imagesConfig: {
      sizes: [640, 750, 828, 1080, 1200],
      formats: ["image/avif", "image/webp"],
      domains: ['a.storyblok.com'],
    }
  })
<Image
  {...getIllustationAttributes(article.image)}
  class="rounded-2xl shadow-2xl object-cover h-full w-full"
/>

The getIllustationAttributes function renders src/alt/width/height depending of my API.

#

Even if I resize my screen the attribute w= stays at 1200. Am I doing something wrong ?