NextJS Image loading only in Firefox

Viewed 21

Images will only load in Firefox and nowhere else.

Here's my import

import gradient from '../public/mountains/gradient.svg'

And here's the Image component

<div id='gradient' className={`${styles.bgimage} ${styles.gradient}`}><Image src={gradient}></Image></div>

This is what it shows in Firefox devtools:

Firefox devtools

And this is what it shows in Chrome devtools:

Chrome devtools

But the weird thing is when I click the link in "Current source:" in Chrome's devtools it shows the image correctly. And another weird thing is that images on the footer load properly

I have tried using the img tag and background-image but that just says 404 Not Found. So I don't know what I'm doing wrong.

1 Answers

So my friend managed to fix it. So I for some reason converted the PNG image to an SVG image and that's why that happened. So I changed it back to the original PNG image and fixed it.

Related