tiangolo / fastapi

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

fastapi dev runs stuck #11573

Open kingcwt opened 1 month ago

kingcwt commented 1 month ago

Privileged issue

Issue Content

The first time I ran fastapi dev, there was no problem, but I encountered a code error. Then after I modified the code and saved it, a WARNING: WatchFiles detected changes in 'tool/index.py'. Reloading... then got stuck and could not exit.

image
ankit-brijwasi commented 1 month ago

Any updates on this @kingcwt? facing the same issue!

3to1null commented 1 month ago

Could be related to: https://github.com/encode/uvicorn/issues/2000

Omachonu-prosper commented 1 month ago

I currently have a slightly different issue from yours @kingcwt but it's still an issue with fastapi cli (dev and run) The Code image

The Error image image

AIdjis commented 1 month ago

do not use the fastapi dev to run your application just use uvicorn instead, i do not face any issue with uvicorn

ceb10n commented 1 month ago

I tryied to reproduce it, but without success.

But sometimes I get the same problem running uvicorn with --reload in cmder/windows. I think it is related to uvicorn instead of fastapi