Assets not loading on the web (ASGI-mode)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17k
- Forks
- 694
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 33
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
Favicon and other images are not loading from assets directory, when deployed to web. Desktop version loads images normally.
Code sample
Logs
Here is how my web app is being started:app = ft.app(
target=main,
export_asgi_app=True,
assets_dir="assets",
)
In the app I simply use an ft.Image widget.
To reproduce
This bug only happens when I deploy my APP using ASGI (I am using hypercorn)
I am also deploying inside a Docker container
Expected behavior
I expected the app to be able to load the images in the assets directory as it does when alunched as a desktop app or a non-ASGI webapp.
Screenshots / Videos
Screenshots / Video demonstration
[Upload media here]
Operating System
Linux
Operating system details
Ubuntu 22.04
Flet version
0.22.1
Regression
I'm not sure / I don't know
Suggestions
No response
Logs
Logs
[Paste your logs here]
Additional details
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ASGI app setup using export_asgi_app, assets_dir, and ft.Image, then reproduce the failure by deploying with Hypercorn in the described Docker environment. Done means the favicon and other images load from the assets directory in ASGI mode as they do in desktop and non-ASGI web modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100