Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Width issue on vercel #1490

Open
ejerskov opened this issue Sep 16, 2024 · 0 comments
Open

Width issue on vercel #1490

ejerskov opened this issue Sep 16, 2024 · 0 comments

Comments

@ejerskov
Copy link

ejerskov commented Sep 16, 2024

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/@nuxt+image@1.8.0_rollup@4.18.0/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant