solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

[Bug?]: docs: favicon.ico is missing in prod

Open glitch-txs opened this issue 2 years ago • 5 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Current behavior 😯

image

Expected behavior 🤔

icon should show in the browser tab

Steps to reproduce 🕹

Steps:

Context 🔦

No response

Your environment 🌎

No response

glitch-txs avatar Jan 09 '24 06:01 glitch-txs

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.

ryansolid avatar Jan 09 '24 20:01 ryansolid

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;

edivados avatar Jan 14 '24 21:01 edivados

Seems to work alright?

Screenshot 2024-03-12 at 15 31 38

birkskyum avatar Mar 12 '24 14:03 birkskyum

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.

ryansolid avatar Mar 12 '24 15:03 ryansolid

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"
    }
}

edivados avatar Apr 13 '24 12:04 edivados