Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Next.js site has favicon in chrome but not in brave

I’m developing my first next.js site and I’m setting the favicon in index.js as follows:

<Head>
  <title>Create Next App</title>
  <link rel="icon" href="/favicon.ico" />
</Head>

Originally I was using a setup where my source files were all in the root directory. I now decided to move them to a src directory. Since then I have observed the following two weird behaviors:

  1. The site has a favicon in chrome but not in brave.
  2. Even if I comment out the above portion the favicon in chrome remains.

The favicon is stored in the public folder which is in the root directory (did not change anything about that) when moving the other files to src.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to remove your cache for the new route of the favicon to be recognized.

To prevent this in the future you could add a removal of the .next directory to remove the cache, example:

  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
    "clean": "rm /_next && next start"
  },
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading