Skip to content

Width issue on vercel #1490

@ejerskov

Description

@ejerskov

Im running @nuxt/image 1.8.0 and deploying to vercel.

I have this image:

  <NuxtImg
    src="logo.png"
    alt="Title"
    densities="x1 x2"
    preload
    format="webp"
    width="90px"
    height="121px"
    sizes="xs:90px sm:90px"
  />

Locally it generates this html correctly:
<img onerror="this.setAttribute('data-error', 1)" width="90" height="121" alt="Fanside for Liverpool FC" data-nuxt-img="" sizes="(max-width: 640px) 90px, 90px" srcset="/_ipx/f_webp&amp;s_90x121/anfieldroad/logo.png 90w, /_ipx/f_webp&amp;s_180x242/anfieldroad/logo.png 180w" src="/_ipx/f_webp&amp;s_180x242/anfieldroad/logo.png" data-v-inspector="../node_modules/.pnpm/@[email protected][email protected]/node_modules/@nuxt/image/dist/runtime/components/NuxtImg.vue:2:3">

However after its been deployed to vercel, the html is:
<img onerror="this.setAttribute('data-error', 1)" width="90" height="121" alt="Fanside for Liverpool FC" data-nuxt-img="" sizes="(max-width: 640px) 90px, 90px" srcset="/_vercel/image?url=%2Fanfieldroad%2Flogo.png&amp;w=320&amp;q=100 90w, /_vercel/image?url=%2Fanfieldroad%2Flogo.png&amp;w=320&amp;q=100 180w" src="/_vercel/image?url=%2Fanfieldroad%2Flogo.png&amp;w=320&amp;q=100">

The width is now 320px.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions