When I run my project in browser I get the "can not find favicon.ico
" error in browser console:
Failed to load resource: the server responded with a status of 404 (Not Found)
:8080/favicon.ico
But when I search for favicon
in whole project in WebStorm it finds nothing:
Wrong file path You need to ensure that your favicon's file path is correct. If you have your icon in the images folder, then make sure that your file path has /images/favicon. ico depending on what you named your icon.
Favicons are declared in the <head> tag of a web page.
A favicon can actually be either a PNG, GIF, or ICO file. However, ICO files are typically used more than others as the file size is smaller and it is supported in all major browsers. PNGs are used more commonly for IOS, Android, and Windows 10 devices.
This is normal. No matter if you declared it or not in your code, Chrome will try will try to fetch favicon.ico at the root of your site to display it in your tab. In your case it will try to fetch: http://localhost:8080/favicon.ico
All browsers will do this except SeaMonkey according to Wikipedia article on Favicon
In the old days, this was the standard way of personalizing the browser icon. Now there is a ton of possible icons you can set for various devices: https://stackoverflow.com/a/26768184/1375487
Also, you can check this answer as it suggests ways to prevent that auto-fetch: https://webmasters.stackexchange.com/a/34572
In any case, the best practice would be to set a favicon.ico for your project.
favicon.ico
is the icon on the title bar in your website.
Browser did not find it in your website.
You should provide it to your index.html
:
<link rel="shortcut icon" href="assets/images/favicon.ico">
The path you can change by your case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With