How to update favicon?

I found https://github.com/wasp-lang/wasp/discussions/934 on this topic. However, I am missing something. I have the following in my app.head section: head: [ "<meta property='og:type' content='website' />", "<meta property='og:image' content='src/client/static/image.png' />", "<link rel='icon' type='image/x-icon' href='src/static/favicon.ico'>", ], I have added my logo as favicon.ico and as image.png in the static folder. I have also deleted the Wasp logo from the folder. However, it is still pulling in the Wasp logo for the favicon from somewhere.. I can not figure out where / why...
GitHub
How can I change favicon? · wasp-lang wasp · Discussion #934
Right now default favicon is Wasp logo, how can I change it?
9 Replies
shayne
shayne2y ago
Hey @hometechdad thanks for the question and research. The favicon shown is placed in the public folder by default for Wasp, and referenced in index.html. You can see the generated project structure (which you should *not *modify) under: .wasp/out/web-app/ We currently don't expose a way to modify the public folder or serve static assets directly, so you would want to reference some public URL. In the (hopefully near) future, we would like to add static asset support, which should cover this use case, or just give an escape hatch for modifying the favicon directly. Based on Martin's answer, I am confident this used to work, but we recently switched to Vite and this may have fallen through the cracks. I just tried and it doesn't seem to work for me locally. @miho do you have any thoughts on this?
hometechdad
hometechdad2y ago
Current work around is the following: After doing the web-app build step npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build I am manually replacing the favicon.ico located in .wasp\build\web-app\build directory with the one I created. Then doing the deploy to Netlify.
martinsos
martinsos2y ago
Uff, that is hackish indeed! I will create an issue for this @hometechdad , thanks for catching this. Closing for now, here is issue https://github.com/wasp-lang/wasp/issues/1205, we will handle this before the next big release!
Ricardo Batista
Ricardo Batista7mo ago
Sorry to revive this, but how can one update the favicon? I placed it under app/public and it still generates with OpneSaaS' default.
No description
miho
miho7mo ago
Did you do a "hard refresh" e.g. CMD + SHIT + R or CTRL + SHIFT + R Sometiems the browser caches the favicon pretty strongly so you need to refresh it like that 🙂
Ricardo Batista
Ricardo Batista7mo ago
Yes, I have already tried that. I see that in the build folder the favicon has an extension .ico, however in /public it has a .svg one. Would that matter?
miho
miho7mo ago
Oh no, it seems that we don't support that behaviour (using favicon with extensions other then "ico"). Let me share some Wasp internals with you: we check if you have a favicon.ico in your public dir and based on that we either include the default favicon.ico or not. This means, that our current logic requires from you to use a favicon file with the .ico extension instead of .svg We have an issue to improve ths: https://github.com/wasp-lang/wasp/issues/1979
GitHub
Place favicon.ico in the public dir by default · Issue #1979 · wa...
Implement what Miho suggested here: #1622 (comment). Instead of magically generating the default favicon.ico and telling users they can override it by placing their own in the public directory, we ...
Ricardo Batista
Ricardo Batista7mo ago
Gotcha, now it all makes sense. Will place favicon.ico in /public then! It works now!
miho
miho7mo ago
I'm glad to hear that 🙏🏼
Want results from more Discord servers?
Add your server