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'
![](https://cdn.answeroverflow.com/1125545180074876959/image.png)
![](https://cdn.answeroverflow.com/1125545180368474152/image.png)
14 Replies
/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?nope just
![](https://cdn.answeroverflow.com/1125550568312672347/image.png)
I see you're in #workers-help - is this using Pages? Or Workers Sites? How are you serving the content specifically?
It's Nuxt 3 compiled to a cloudflare worker
I'm serving it locally through wrangler dev
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
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
GitHub
GitHub - Geometrically/repro-nuxt-favicon
Contribute to Geometrically/repro-nuxt-favicon development by creating an account on GitHub.
just a couple files with the issue
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
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
https://github.com/unjs/nitro/pull/933 sounds remarkably similar to what you're experiencing
are you using an old version per chance?
nope that min repro version is the latest version of nuxt
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
gotcha, thanks so much
i'll make an issue with them