I am getting an error while trying to add a PNG or SVG file to my code. What is my mistake is or what do I have to change to get it working?
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
export default function Home() {
return (
<div className={styles.container}>
<Head>
<title>Maintenance</title>
<meta name="description" content="This Website is in Maintenance Mode" />
<link rel="icon" href="/favicon.ico" />
</Head>
<div className={styles.main}>
<h1 className={styles.h1}>This website is currently in</h1>
<break></break>
<h1 className={styles.h2}>Maintenance Mode.</h1>
<Image
src="/public/logoicon/logoOrange.png"
alt="server and database with broken cable"
width={77}
height={33}
/>
<p className={styles.p}>©2022 Karlo-Hosting.com</p>
</div>
</div>
)
}
My code is above.
received text/html; charset=utf-8
is a strong indicator that your server returned an HTML document, instead of an actual image - most likely that of your 404 error page. Have you checked how the request got answered, using your browser dev tools? – Tehuantepecsrc="/logoicon/logoOrange.png"
. See nextjs.org/docs/basic-features/static-file-serving. – Adamec