Hello I'm using Nextjs for my portfolio and I'm using static pictures, the problem I find with the placeholder="blur" on next/image Image component is it doesn't work when I'm mapping through an array to display multiple pictures, the problem i get us this:
Error: Image with src "" has "placeholder='blur'" property but is missing the "blurDataURL" property. Possible solutions: - Add a "blurDataURL" property, the contents should be a small Data URL to represent the image - Change the "src" property to a static import with one of the supported file types: jpeg,png,webp,avif (animated images not supported) - Remove the "placeholder" property, effectively no blur effect Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url
Now here it's demanding the blurDataURL while I'm only using static imported pictures which are mapped through in an Array.
import scrumCourse from "@/assets/images/scrumCert.webp"
the array:
const certificates = [{
name: "scrum-cert",
avatar: scrumCourse, // statically imported picture
link: "https://udemy..........", },]
Here is snippet of my code :
{[...new Array(10)].fill(0).map((_, index) => (
<Fragment key={index}>
{certificates.map(certificate => (
<Card key={certificate.name} className="max-w-[400px] md:max-w-md p-2 md:p-4 items-center transition duration-300 hover:rotate-1">
<Link href={certificate.link} target="_blank" >
<div className="relative w-[416px] h-[321.45px] object-cover">
<Image
src={certificate.avatar}
alt={certificate.name}
placeholder="blur"
fill
className="max-h-full rounded-3xl" />
</div>
</Link>
</Card>
))}
</Fragment>
))