Favicon.ico not being found - Nuxt

Hello! I am deploying my Nuxt 3 site to Cloudflare Workers. Most stuff is working fine so far, but the favicon isn't for some reason. I am storing it in the public directory of my site. All other items besides the 2 favicons can be accessed fine, but the favicons error. See the attachments for the file structure. In the console, I get this error when trying to access it: [mf:err] Error: ENOTDIR: not a directory, open '/Users/geometrically/Documents/Coding/modrinth/knossos/.output/public/favicon.ico/index.html'
14 Replies
James
James12mo ago
/Users/geometrically/Documents/Coding/modrinth/knossos/.output/public/favicon.ico/index.html is a weird path. It's treating favicon.ico as a directory for some reason 🤔 Are you hittting /favicon.ico/ or something like that?
Geometrically
Geometrically12mo ago
nope just
James
James12mo ago
I see you're in #workers-help - is this using Pages? Or Workers Sites? How are you serving the content specifically?
Geometrically
Geometrically12mo ago
It's Nuxt 3 compiled to a cloudflare worker I'm serving it locally through wrangler dev
James
James12mo ago
Hmm okay I'm not familiar with how Nuxt compiles to a Worker - hopefully someone else in the server can take a look and help ya out soon 🙂 Or if you have a minimal repro repo, I'd be happy to poke around
Geometrically
Geometrically12mo ago
yeah let me try making one real quick, I'm having another issue too so I'll make one for that and make a seperate thread
Geometrically
Geometrically12mo ago
GitHub
GitHub - Geometrically/repro-nuxt-favicon
Contribute to Geometrically/repro-nuxt-favicon development by creating an account on GitHub.
Geometrically
Geometrically12mo ago
just a couple files with the issue
James
James12mo ago
so I'm not able to reproduce the thing you're seeing, with the /index.html but I do see it hitting this codepath: https://github.com/unjs/nitro/blob/1950d1e24ea8463681a35fc48da8cbc09fe16774/src/runtime/renderer.ts#L18 and I'm served data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 for /favicon.ico
Geometrically
Geometrically12mo ago
hmm yeah that's the weird thing, but if you add other stuff to the public directory it serves fine so it looks like it's a nuxt bug? wait is it? because shouldn't workers not even match the route at all
James
James12mo ago
https://github.com/unjs/nitro/pull/933 sounds remarkably similar to what you're experiencing are you using an old version per chance?
Geometrically
Geometrically12mo ago
nope that min repro version is the latest version of nuxt
James
James12mo ago
Yeah this definitely seems like a bug in how nuxt/nitro etc. is handling this URL and serving the static asset vs something that's SSR'd
Geometrically
Geometrically12mo ago
gotcha, thanks so much i'll make an issue with them
Want results from more Discord servers?
Add your server
More Posts