Open Erick-Bryan-Cubas opened 8 months ago
Was the GPT essay really necessary 😂?
To clear up any misunderstanding, Flask does not natively support async. You need to install Flask[async]
for it to work.
If you already made your project with Flask installed, it could be that Flask[async]
isn't being detected.
You can try to pip uninstall Flask
and then try installing it again with the async extra and see if that works.
You can look at this SO Thread, there's a bunch of solutions.
Issue Description
I am encountering a
RuntimeError
when attempting to use async views with Flask3.0.2
and Flask-SocketIO. The application is designed to serve web content with Flask and utilize Flask-SocketIO for WebSocket communication. I have followed the recommended practices for async support in Flask and Flask-SocketIO, including ensuring all related packages are up to date. However, the issue persists, preventing the use of async routes.Environment
Error Output
Steps to Reproduce
Expected Behavior
The application should handle the async route without any errors, leveraging Flask’s support for async views.
Actual Behavior
A
RuntimeError
is thrown, stating the need to install Flask with the 'async' extra, even though the current Flask version (3.0.2) should support async operations natively.Attempts to Resolve
async
extra (pip install "flask[async]"
), although this should not be necessary with Flask’s native async support.Despite these efforts, the problem remains unresolved. I am seeking guidance on how to properly configure Flask and Flask-SocketIO for async views or if there is a known issue with the current versions that might be causing this problem.
Thank you for your support.