firebasenext.jsfavicon

Setting a custom favicon.ico / nextJS app (Firebase)


I have a nextJS app on firebase which has been created using these commands on the terminal:

 % npx create-next-app@latest
 % cd myapp
 % firebase experiments:enable webframeworks
 % firebase init hosting
 % npm i react-firebase-hooks

I am now trying to set a customized favicon.ico for it.

But for some reasons I keep seeing the old default icon and not mine.

I assume I am not doing what is needed, but can't find why.

I replaced all the favicon.ico files that I could find with my new one, but to no avail.

What is the proper way to set a favicon.ico in this context ?


Solution

  • If you are using Next version 14, you must replace favicon.ico inside the app folder and then delete the .next folder to delete the cache. Finally run your application and the favicon will change, you can also perform a hard reload on the browser to make sure you clear the cahe in the browser.