Search code examples
reactjsexpresscreate-react-app

Why do I keep getting a 500(Internal Server Error) GET http://localhost:3000/favicon.ico 500 (Internal Server Error)?


When I began this project I didn't keep anything from the CRA files that are generated, so why do I still get this error, where is it comming from?

GET http://localhost:3000/favicon.ico 500 (Internal Server Error)

As I said, I have created my own ./public/index.html in which I am not specifying a favicon. What is the source of this error and how can I get rid of it?


Solution

  • As I said, I have created my own ./public/index.html in which I am not specifying a favicon. What is the source of this error and how can I get rid of it?

    Browsers automatically request the favicon. If no favicon is specified in the html file an automatic request is made to <protocol>://<domain>/favicon.ico

    I added an empty link for favicon and i doesn't work. <link rel="shortcut icon" href="">

    The browser still sees an empty href as a favicon that has not been specified in the html file.

    You can set your own favicon url via the href in <link rel="shortcut icon"> and serve an .ico file or just ignore the requests. At this time I'm not aware of a way to disable the favicon requests entirely.