Next.js Discord

Discord Forum

How to use custom/emoji favicon

Unanswered
Chausie posted this in #help-forum
Open in Discord
ChausieOP
I'm trying to use a custom favicon; I've done this before by changing _app.tsx, but this isn't working in the most recent version of next.

So, I tried to create a dynamic icon file (icon.tsx):

export default function Icon() {
  return (
    <link
      rel="icon"
      href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🎤</text></svg>"
    />
  );
}


This doesn't work either.

Is there no way for me to declare my own icon?

5 Replies

ChausieOP
It's still complaining:

Module not found: Can't resolve '/src/app/icon.tsx?next_metadata'
removing .next should resolve the issue
(of course this icon.tsx is no longer necessary, delete it)
remove .next and start the dev server again
ChausieOP
that works! Thanks!