只需替换 favicon.ico 即可,chrome 无法显示。这似乎是一个错误。我使用应用程序路由器。
/-应用程序 /-favicon.ico
我发现很多人都遇到过这个问题,我找到了如何解决这个问题:
1.将 favicon.ico 重命名为 icon.ico,然后将 icon.ico 移动到 src/app 文件夹。现在上班了。
或
使用 /public 文件夹中的 icon.png。不直接在/app中。请注意引用layout.jsx中的图像
//layout.jsx
import "./globals.css";
export const metadata = {
title: "something",
description: "something"
};
export default function RootLayout({ children }) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<link rel="icon" href="/icon.png" />
</head>
</html>
);
}