Next.js Discord

Discord Forum

Favicon not working

Unanswered
Siberian Accentor posted this in #help-forum
Open in Discord
Avatar
Siberian AccentorOP
In my Nextjs 13 project, my favicon is not working for some reason. The file for the favicon is correct, but it is not applying to the website. My favicon is in the public > resources folder. I am configuring the favicon in the layout.tsx file, anyone know why this isn't working?

import Head from 'next/head';
import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
  title: "FitnessAI",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <Head>
        <link rel="icon" href="/resources/favicon.ico" />
      </Head>
      <body className={inter.className}>{children}</body>
    </html>
  );
}

4 Replies

Avatar
Thrianta
try setting your head component to lowercase instead of uppercase
since you're in the layout
Avatar
Siberian AccentorOP
That worked, thank you
Avatar
Thrianta
👍