Change favicon in wasp file
How to change the favicon in the wasp file. I have an image I want to use in public/favicon.png, I tried: "<link rel='icon' type='image/png' href='/favicon.png' />" but I still see the old da boi
3 Replies
Wohooo @johnsharp., you just became a Waspeteer level 1!
Hi @johnsharp.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To change the favicon in a Wasp project, you don't need to modify the
.wasp
file directly. Instead, you can simply place your favicon file in the public
directory. Wasp will automatically use the favicon from this directory.
Here's how you can do it:
1. Place your favicon file (e.g., favicon.ico
or favicon.png
) in the public
directory at the root of your project The public
Directory (https://wasp-lang.dev/docs/project/static-assets#the-public-directory).
2. Make sure your favicon file is named favicon.ico
for best compatibility. If you're using a PNG file, you might need to adjust your HTML head accordingly.
3. Wasp will automatically serve this file at the root path /
during development and copy it to the root of the dist directory during build.
If you've already placed your favicon.png
in the public
directory and you're still seeing the old favicon, it might be due to caching. Try the following:
1. Hard refresh your browser (Ctrl + Shift + R or Cmd + Shift + R on Mac) to clear the cache for that page.
2. If that doesn't work, try clearing your browser cache completely.
If you're still having issues after these steps, it's possible that there might be a conflicting favicon declaration somewhere in your project. Double-check that there are no other favicon declarations in your HTML head or in the Wasp configuration.
Remember, you don't need to add a <link>
tag in the .wasp
file for the favicon. Wasp handles this automatically when it finds a favicon.ico
file in the public
directory Add favicon support (https://github.com/wasp-lang/wasp/issues/9).
If you continue to have problems, you might want to check if there are any issues with your project setup or consider reaching out to the Wasp community for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @johnsharp., I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Simple when you know, thanks