frankieseattle
frankieseattle

Reputation: 181

Receiving an error when deploying react app to vercel

Having issues deploying my create-react-app project to Vercel using their dashboard. I removed all of my images from my src and am calling them like src={"images/my-image.png"} from myenter image description here public folder.

It deploys fine with no errors in my localhost. Am I needed to clear a cache somewhere? Please help!

enter image description here

Upvotes: 1

Views: 742

Answers (1)

Matee Suttapak
Matee Suttapak

Reputation: 74

You can change src={'string'} to

import Avatar3 from '../public/images/avatar-3.png'

...
    <Image src={Avatar3} ... />
...

src

Must be one of the following:

  • A statically imported image file, or
  • A path string. This can be either an absolute external URL, or an internal path depending on the loader prop or loader configuration.

ref. https://nextjs.org/docs/api-reference/next/image

Upvotes: 1

Related Questions