Next.js Discord

Discord Forum

Image placeholder

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Hello,
I'm trying to make my images appear better when they load in, so I put a placeholder image, but the placeholder disappears when the high quality one starts loading in on firefox but not on edge.
<Image
    className='
        w-full
        max-w-prose
        aspect-square
        rounded-2xl
    '
    src={Selfie}
    alt='Portrait of a young man wearing a student cap and a black suit with a red tie.'
    width={562}
    height={562}
    blurDataURL=' data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAPNQTFRFW0keFREFJR4JSUMtDgwEEQ8EEw4ECgcCCQcCEQ4EWUkfOzIYIR4TCAcDCwgDCwcDBwYCCgcDDwsEUUIcGBQFVUwrCgkDBwUBCggDDQkERDgYGxUFW1IyCAYCCwkDDwwDDgkENy4SIhsITEUsDAkDEg8FNCwQGBQJDAkEDgkDLiUNKCEMPjcgDQsDCAcCGBUGST8cGRQKDQkFKSEKKSIOVkcgDgsDJCAKT0MfGRUKKSAJIxwLY1EfGhUIKCMKT0IeHhkLKiEIFhEFZ1YlNzAYDQoDKCIKTD8bLycQDQgDKiEGbWE4PzkjJSAISTwXRjkXDQgEswbEGAAAAHZJREFUeJxjYGBkYmZhZWPn4GTgYuTm4eXjFxAUYhAWERUT4BMXkJBkkJKWkZCVk5fgU2BQVFJW4VVVU9fQZNDS1tHV0zcwNNJkMDYxNZMwt7CU1GSwsraxlbOzd9BQYHB0cnZxdXP30PBk8HL19pHz9fPnCwAALcMOpQsiKTMAAAAASUVORK5CYII='
    placeholder='blur'
/>

When I add a mask to the image, the placeholder disappears in Firefox as well.
img.blob {
    -webkit-mask-image: url('../public/img/blob.svg');
            mask-image: url('../public/img/blob.svg');
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
}

What can I do to fix this?

4 Replies

Toyger
what version of nextjs are you on? there was couple issues on vercel about this, but they now closed, so theoretically in latest versions it should be fixed.
Cape lionOP
If you want to know, here is what I currently have installed:
├── autoprefixer@10.4.16
├── eslint-config-next@14.0.4
├── eslint-config-prettier@9.1.0
├── eslint@8.56.0
├── next@14.0.4
├── postcss@8.4.32
├── react-dom@18.2.0
├── react@18.2.0
└── tailwindcss@3.4.0
@Cape lion i'm on version 14.0.4
Toyger
then probably it's not fixed yet, you can try to open new issue on github, but previously check that all other issues related to bug are closed