当我开始这个项目时,我没有保留生成的 CRA 文件中的任何内容,那么为什么我仍然收到此错误,它来自哪里?
GET http://localhost:3000/favicon.ico 500 (Internal Server Error)
正如我所说,我创建了自己的 ./public/index.html,其中我没有指定网站图标。 此错误的根源是什么以及如何消除它?
最佳答案
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?
浏览器自动请求网站图标。如果 html 文件中未指定网站图标,则会自动向 <protocol>://<domain>/favicon.ico
发出请求。
I added an empty link for favicon and i doesn't work.
<link rel="shortcut icon" href="">
浏览器仍然将空 href 视为未在 html 文件中指定的图标。
您可以通过<link rel="shortcut icon">
中的href设置您自己的favicon url并提供 .ico 文件或忽略请求。
目前我不知道有什么方法可以完全禁用网站图标请求。
关于reactjs - 为什么我不断收到 500(内部服务器错误)GET http ://localhost:3000/favicon. ico 500(内部服务器错误)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62116093/