Prevent Chrome from requesting the favicon for every route change

There is this old bug in Chrome that causes it to request the favicon for every route change in Remix.

In production, this isn't a problem since the favicon is cached. However, in development, it clutters the network logs especially when setting unstable_shouldReload to false and expecting no resources to be fetched.

To fix in development, we can an inline Data URL version of the icon or a placeholder one.

Here's what I use to render an inline dark square favicon in development:

export const links: LinksFunction = () => {
  return [
      rel: "icon",
        process.env.NODE_ENV === "development"
          : "/favicon.png",
      type: "image/png",

I advice against using that in the production enviroment as it'll add 500 bytes (or whatever the size of your encoded favicon) to the document for the initial page load for returning users that would've been cached otherwise.