microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.21k stars 515 forks source link

Fail to debug a Flask python project with an error #4119

Closed v-chenzha closed 11 months ago

v-chenzha commented 11 months ago

OS: All Build Version: 20231013.1 Regression: Previous Release

Repro Steps:

  1. Open a Flask python project flask_project.zip in VS Code.
  2. F1 -> Docker: Add Docker Files to Workspace -> Python: Flask -> Include docker compose files.
  3. F5.
  4. Check whether succeeds to debug the Flask python project.

Expect: Succeed to debug the Flask python project without any error.

Actual: Fail to debug Python flask project with an error. image

More Info: Succeed to debug Django and General python projects.

alexyaang commented 11 months ago

I was able to reproduce this error and after some research I found this stack overflow thread here https://stackoverflow.com/a/77214086/21528633. I added Werkzeug==2.2.2 to requirements.txt as the answer mentioned and everything worked just fine.

It's an issue with flask and not our tooling.

bwateratmsft commented 11 months ago

@alexyaang we may need to update the requirements.txt template for Flask to include Werkzeug. Or, try bumping the Flask dependency up to e.g. 3.0.0.

alexyaang commented 11 months ago

@bwateratmsft yeah, this seems like a very recent change by flask as the thread started this month, we should definitely consider making some sort of change to adapt.

alexyaang commented 11 months ago

After talking offline with Brandon, we decide to update the requirements.txt template for Flask to have flask==3.0.0.