Skip to content
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

Favicon not loading in web app #5077

Open
gual11 opened this issue Mar 13, 2025 · 4 comments
Open

Favicon not loading in web app #5077

gual11 opened this issue Mar 13, 2025 · 4 comments

Comments

@gual11
Copy link

gual11 commented Mar 13, 2025

Hi,
I added the favicon into the assets directory, but nothing changed.

I am working with fastapi mounting the main page like this:
app.mount("/", flet_fastapi.app(main, assets_dir="assets"))

for hosting I call the following command:
uvicorn main:app --port 8080

Am I doing something wrond? How can I the png to change for the favicon and the icon/loading-animation.png?

@gual11
Copy link
Author

gual11 commented Mar 13, 2025

def main(page: ft.Page): img = ft.Image( src=f"/icons/abc.png", width=100, height=100, fit=ft.ImageFit.CONTAIN, ) btn_test_link = ft.ElevatedButton(text='ABC', url='http://go-there:8080/') page.add(img,btn_test_link) page.update() app = flet_fastapi.FastAPI() app.mount("/", flet_fastapi.app(main, assets_dir='assets'))

@gual11
Copy link
Author

gual11 commented Mar 13, 2025

fastapi 0.115.11
flet 0.27.6
flet-web 0.27.6

@gual11
Copy link
Author

gual11 commented Mar 13, 2025

same happening with images, can't show them

@gual11
Copy link
Author

gual11 commented Mar 14, 2025

INFO: 127.0.0.1:52848 - "GET /images/hello.png HTTP/1.1" 200 OK
INFO: 127.0.0.1:52848 - "GET /flutter_service_worker.js?v=713049676 HTTP/1.1" 304 Not Modified

with some pics it magically works, with some it doesn't although log says OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant