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
James•2y 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
GeometricallyOP•2y ago
nope just
James
James•2y ago
I see you're in #workers-help - is this using Pages? Or Workers Sites? How are you serving the content specifically?
Geometrically
GeometricallyOP•2y ago
It's Nuxt 3 compiled to a cloudflare worker I'm serving it locally through wrangler dev
James
James•2y 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
GeometricallyOP•2y 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
GeometricallyOP•2y ago
GitHub
GitHub - Geometrically/repro-nuxt-favicon
Contribute to Geometrically/repro-nuxt-favicon development by creating an account on GitHub.
Geometrically
GeometricallyOP•2y ago
just a couple files with the issue
James
James•2y 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
GeometricallyOP•2y 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
James•2y 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
GeometricallyOP•2y ago
nope that min repro version is the latest version of nuxt
James
James•2y 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
GeometricallyOP•2y ago
gotcha, thanks so much i'll make an issue with them
Want results from more Discord servers?
Add your server