Next.js Discord

Discord Forum

Favicon not working

Answered
Common paper wasp posted this in #help-forum
Open in Discord
Common paper waspOP
First time messing around with the app router and i like it but im having some issues with my favicon

I did go through some others previous forums about this issue but nothing seems to be working.


Heres what ive got
export const metadata = {
  title: "Imagen | Home",
  description: "Generate images with a click of a button!",
  icons: {
    icon: {
      rel: "icon",
      sizes: "48x48",
      url: "/favicon.ico",
    },
  },
};
Answered by Common paper wasp
I did solve it but for future reference incase anyone else runs into this, try clearing your browsers cache
View full answer

3 Replies

Common paper waspOP
It looks like its being read because i can view the icon through the Elements console
Common paper waspOP
I did solve it but for future reference incase anyone else runs into this, try clearing your browsers cache
Answer
You can also just add the image file to your app directory instead of putting it in the public folder.
https://nextjs.org/docs/app/api-reference/file-conventions/metadata/app-icons