Open tioans opened 3 weeks ago
Hey there, @tioans! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this issue together!
The issue you're encountering with the TaskList
element not loading correctly when the Chainlit app is mounted as a FastAPI sub-app might be related to how the Chainlit app handles routing and requests in this setup. When Chainlit is mounted as a sub-app, certain configurations or environment variables might not be set correctly, affecting the functionality of specific elements like TaskList
.
Here are a few things you can check or try:
Environment Variables: Ensure that the necessary environment variables are set correctly. The mount_chainlit
function sets CHAINLIT_ROOT_PATH
and CHAINLIT_SUBMOUNT
environment variables, which are crucial for the app to function properly as a sub-app [1].
Debugging: Enable debugging by setting the CHAINLIT_DEBUG
environment variable to True
. This might provide more detailed error messages that can help identify the issue.
Check for Errors in Console: Look for any error messages in the console where you are running the FastAPI app. These messages might give more insight into what is going wrong.
Update Chainlit: Ensure you are using the latest version of Chainlit, as updates might include bug fixes related to FastAPI integration.
Review TaskList Implementation: The TaskList
implementation involves asynchronous operations and JSON serialization. Ensure that these operations are not being disrupted by the FastAPI integration [2].
If these steps do not resolve the issue, it might be necessary to delve deeper into the integration specifics or consider reaching out to the maintainers for more detailed support.
To continue talking to Dosu, mention @dosu.
@tioans Thanks so much for pointing this out! @willydouhard has created a PR attempting to fix this.
We'd greatly appreciate if you're perhaps able to confirm whether indeed his patch resolves your issue. Just the little extra testing that helps us ensure quality. :)
Describe the bug When the Chainlit app (v1.2.0) is mounted as a FastAPI sub-app using mount_chainlit, a TaskList element fails to load, displaying "An error occurred" in the top-right corner where the task list should be. However, the Chainlit app works correctly when run directly without mounting to FastAPI.
To Reproduce Steps to reproduce the behavior:
Expected behavior The TaskList element should load and display the tasks as expected, as it does when the Chainlit app is run directly without mounting to FastAPI.
Screenshots
Desktop (please complete the following information):