tiangolo / fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production
https://fastapi.tiangolo.com/
MIT License
73.21k stars 6.17k forks source link

README Update to Account for Keyboard Interrupt Error with Current Uvicorn Version #11642

Closed pollyandhiscat closed 1 month ago

pollyandhiscat commented 1 month ago

When using the current version of Uvicorn shipping with FastAPI, a specific error will occur when running the server in dev mode. When you make a change to the 'main.py' file, the console throws a long error string, which ends up being related to a keyboard interrupt issue. Below are some screenshots:

image

image

image

image

In short, the workaround is simple: roll back to a prior version of Uvicorn. This README update simply lets FastAPI users know there is an issue with Uvicorn and that this small step can be taken to avoid a lot of confusion.

Command to roll back:

image

Then after saving file changes, you get the nice clean output we all like to see:

image

I know this is technically an issue with an external library, but it is an external library referenced directly by the current version of the README and this change might save some people headaches.

Note: my images here are using PowerShell, but the change to the README is not picky.

Kludex commented 1 month ago

I'll make a release on uvicorn's side.

pollyandhiscat commented 1 month ago

@Kludex Thank you! Most appreciated! 🙌