-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to change favicon in app.html head #11158
Comments
What does "unable to change" it mean? That the browser isn't picking up the new image? Browsers cache favicons very aggressively. |
@Conduitry, How would you suggest I overcome the aggressive caching? It's a really simple site and my static folder looks like so. All advice online looks the same A very weird issue I see is that all of the lines that are supposed to be added to the head are showing up in the body. However, when I move all these same lines to svelte:head which shouldn't be necessary, it still doesn't work. If I edit the |
Please provide a minimal reproduction in the form of a repository |
Thanks @eltigerchino and @Conduitry - here is a reproducer -> https://github.com/ucheNkadiCode/faviconBug/tree/main |
After a bit more tweaking, what I see is that the issue may have been that I was using It's a pretty weird bug. I don't know if it is expected behavior but I believe your docs would need to be updated to reflect this specific nuance. My <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" />
<link rel="apple-touch-icon" sizes="180x180" href="%sveltekit.assets%/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="%sveltekit.assets%/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="%sveltekit.assets%/favicon/favicon-16x16.png">
<link rel="manifest" href="%sveltekit.assets%/favicon/site.webmanifest">
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html> |
Yeah, Svelte syntax shouldn’t be used inside a HTML file. I wonder if we should throw an error for this or have some kind of HTML file validation? |
That would be super helpful! And/Or just adding something in the docs about svelte head not being available in app.html could have saved me a lot of time. Thanks for the help, this solved my issue |
Describe the bug
My package JSON
My app.html file is such
I've tried what feels like everything and used favicon.io to create my images. I then created a favicon folder in the static folder which should work, but nothing is working. I've also tried moving these links into svelte:head but that didn't work either.
Am I missing something? Could it be an issue in the
svelte.config.js
file? It's not working locally nor on the deployed website.Reproduction
It's svelte app created with the basic template
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: