#Favicon with file-based metadata + standalone build not working

7 messages · Page 1 of 1 (latest)

unreal thicket
#

Next version: 13.3.1
Following the docs https://beta.nextjs.org/docs/api-reference/metadata#file-based-metadata I put a favicon.ico file under src/app/ (the App directory).
However when building using the output: "standalone"and serving using the command node .next/standalone/server.js the favicon doesn't show correctly, and inspecting the network, /favicon.ico returns 500.
Anyone know what I may be doing wrong?

Learn how to add Metadata to your Next.js application for improved search engine optimization (SEO) and web sharability.

rugged nymph
#

Having same issue even on dev server. The favicon returns 404. But it works if you put it in /public.

unreal thicket
#

Sorry, I should have specified I'm trying to deploy with docker. I noticed in the console I would get an error about not finding app/src/app/favicon.ico not existing. I fixed it by manually creating the folder and copying the favicon to ./app/src/app inside the node container, using the node dockerfile found in the docs as base. I tried changing the path which Next uses (using export metadata in the root layout.tsx) but with no results.

unreal thicket
rugged nymph
unreal thicket
#

In dev it works for me, placing the favicon under the experimental app directory. However, to be fair, in dev it also works by having the favicon under the public folder

fair vortex
#

I'm also seeing this issue! The next build step doesn't seem to be copying the icon.svg file into public - so the error returns an internal FileNotFound error when anyone queries the public favicon link defined in the <meta>