I'm facing an issue with debugging a Python Flask project in Visual Studio 2022 that involves JavaScript code. I've created a small project using the built-in Python Flask template. The problem I'm encountering is related to debugging JavaScript code.
Here's what's happening:
- When I set a breakpoint in the Python code, the breakpoint works as expected.
- If I set a breakpoint in the embedded JavaScript code within the HTML template, the breakpoint also works fine.
- However, when I create a separate
.jsfile containing JavaScript code and import it into the HTML template, setting breakpoints in this external JavaScript code doesn't work, and the execution doesn't stop.
I've verified that the JavaScript code in the .js file is executing (I added a console.log statement).
I've tested this issue on Chrome, Edge, and Firefox, and launched Chrome and Edge in debug mode using --remote-debugging-port=9222. I confirmed that the debug mode is active using http://localhost:9222/json/version.
I've also connected Visual Studio 2022 to both browsers using "Debug/Attach to Process...".
I've tried running Flask with both debug=True and debug=False, and I've attempted debugging in both Debug and Release modes.
I´ve enabled and disabled the "Enable Just My Code".
Despite trying these steps, I haven't been able to make the breakpoints in the external JavaScript file work during debugging.
Microsoft Visual Studio Enterprise 2022 (64-bit) Version 17.7.1
Question: Is there a solution to enable full debugging functionality from Visual Studio 2022, avoiding the need to manually set breakpoints within the browser, including ´.js´ files from static assetts?