How to debug JavaScript in VSCode on a Flask project?

I have a similar question to this unanswered one. I am not yet allowed to comment on said question.

Is it possible, and if so, how can I debug the JS components of my Flask app from within VSCode?

I have the following debug configuration:

"version": "0.2.0",
"configurations": [
    {
        "name": "Python: Flask - Dev",
        "type": "python",
        "request": "launch",
        "module": "flask",
        "env": {
            "PIPENV_VENV_IN_PROJECT":"1",
            "FLASK_APP":"run.py",
            "FLASK_ENV":"development",
            "FLASK_DEBUG":"1",
            "TEMPLATES_AUTO_RELOAD" : "1"
            
        },
        "args": [
            "run"
        ],
        "jinja": true
    },
    {
        "name": "Python: Flask - initDB",
        "type": "python",
        "request": "launch",
        "module": "flask",
        "env": {
            "PIPENV_VENV_IN_PROJECT": "1",
            "FLASK_APP": "run.py",
            "FLASK_ENV": "development",
            "FLASK_DEBUG": "1",
        },
        "args": [
            "run",
            "--no-reload" // Use for initial dev DB deploy
        ],
        "jinja": true
    }
]

From what I gather, it is possible to use the remote debugging feature of Firefox Developer Edition with its own configurations as per here.

Any ideas on how to combine these configurations? Or perhaps another solution to the problem altogether?

Source: Ask Javascript Questions

LEAVE A COMMENT