I am unable encounter the same issue. When I run your code, I do not get the issue.
Have you tried running: curl 127.0.0.1:8000/
to see if you get an a response? This could be an issue with your browser blocking HTTP sites.
Additionally, can you provide the version of uvicorn, fastapi, and python.