My next image component renders my image path correctly while coding locally, but when I deploy to vercel the image paths are broken.
This is my image component:
<Image
src={convertPath(thumbnail.regular?.large)}
width={1400}
height={1400}
alt="logo"
className="rounded-lg w-full h-[110px] sm:h-[140px] lg:h-[174px] bg-cover bg-center"
/>
This is the file path from the object array:
{
title: "Beyond Earth",
thumbnail: {
trending: {
small: "./assets/thumbnails/beyond-earth/trending/small.jpg",
large: "./assets/thumbnails/beyond-earth/trending/large.jpg",
},
regular: {
small: "./assets/thumbnails/beyond-earth/regular/small.jpg",
medium: "./assets/thumbnails/beyond-earth/regular/medium.jpg",
large: "./assets/thumbnails/beyond-earth/regular/large.jpg",
},
},
year: 2019,
category: "Movie",
rating: "PG",
isBookmarked: false,
isTrending: true,
},
This is the convertpath function (for context):
export default function convertPath(inputPath: string): string {
const newPath = inputPath.replace('./assets', '/../public/assets');
return newPath;
}