DevFlow

DevOverflow

Search
Menu
DevFlow

DevOverflow

Home menu icon

Home

Community menu icon

Community

Collections menu icon

Collections

Find Jobs menu icon

Find Jobs

Tags menu icon

Tags

Ask a question menu icon

Ask a question

    Profile

    Juan Cruz Cáceres

    upvote

    0

    downvote

    0

    star

    Why does Next.js image optimization change my image to a square only in production?

    clock icon

    Asked 9 months ago

    message

    0 Answers

    eye

    1 Views

    I have an image rendered using the Next.js Image component, hosted on imgbb. Everything works fine on my local environment, but after deploying to Vercel, the image’s dimensions become strange, and it appears as a square. I suspect that sharp might be transforming it into a square during optimization.

    Has anyone experienced a similar issue? Is there any way to fix this problem? It's been troubling me for a while.

    <Image
      className="mb-5 w-full rounded-lg object-cover"
      src={coverImage}
      alt={title}
      width={1000}
      height={500}
    />
    
    React
    next
    vercel

    Write your answer here

    0 Answers

    Menu

    Top Questions

    How to center a div?

    chevron

    How to do code parsing with React.js and NextJS?

    chevron

    How to get better at Nextjs?

    chevron

    Postgres: upgrade a user to be a superuser? ?

    chevron

    This is another test question

    chevron

    Popular Tags

    nextjs

    6

    React

    4

    next.js

    3

    reactjs

    3

    css

    3