-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Lifespan state is not passed when a FastAPI app mount a Nicegui app #3094
Labels
enhancement
New feature or request
Milestone
Comments
Thanks for bringing this up @RomainEconomics. I was not aware about the ability to yield state in a lifespan context manager. Would you like to create a pull request for this? |
Yes, for sure |
Wonderful. Thank you so much, @RomainEconomics! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Following this example: https://github.com/zauberzeug/nicegui/tree/main/examples/fastapi
But simply adding a lifespan with some state in the main app:
When calling the "/" route, the state dict is empty.
However, this works normally when running the app without mounting the frontend.
This seems to come from the fact that in the ui_run_with.py the state is not passed.
When yielding the state, this works again
The text was updated successfully, but these errors were encountered: