[Bug?]: docs: favicon.ico is missing in prod
Duplicates
- [X] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Current behavior 😯
Expected behavior 🤔
icon should show in the browser tab
Steps to reproduce 🕹
Steps:
Context 🔦
No response
Your environment 🌎
No response
It's very odd. I must admit. I see the file in my local builds. I presume it makes it to cloudflare and yet it doesn't get served by the static asset.
This is what I could find out.
kv-asset-handler tries to determine the type of /favicon.ico with mime, fails and loads /favicon.ico/index.html.
The interessting thing is that ico and other extensions which should be there are missing from mime. Why that is I don't know. Tried to force everything to kv-asset-handler: 0.3.0 and mime: 3 but no luck. Maybe something else is messing with it.
var Mime_1 = Mime$1;
var standard = {...}
let Mime = Mime_1;
var lite = new Mime(standard); // <=== where is the others map?
var mime_1 = mime$1.exports;
Seems to work alright?
I think that is an old saved one. I still see us returning an HTML page on that request. Somehow it isn't there or isn't matching on static assets first.
The answer was right there...🤦♂️
This was fixed for the pages preset. There is an open issue for the cloudflare preset and apperently also applies to cloudflare_module.
mime/lite seems to be pulled in by unenv. Adding an alias to the full mime db like it was done for pages works around the problem. Gave it a quick try locally and worked.
server: {
preset: "cloudflare_module",
alias: {
"_mime": "mime/index.js"
}
}