[Django]-Visual studio code breakpoint set to grey color & not working.error(may be excluded because of "justMyCode" option)

29πŸ‘

βœ…

are you using a launch configuration to run the debugger? i had the same issue and resolved by adding "justMyCode": false inside the launch.json for the proper entry.

πŸ‘€Equinox23

8πŸ‘

I was only able to add Breakpoints to 3rd party libraries when I set 2 options:

  1. on the launch.json file:
    add "justMyCode": false to the configuration.

  2. on Settings>Features>Debug
    Turn on the option Allow Breakpoints Everywhere

  3. (alternative to 2.) on the file settings.json
    add "debug.allowBreakpointsEverywhere": true

Tested on: version: 1.63.2

πŸ‘€MTex

2πŸ‘

enter image description here

Have you tried left hand side green button on the top instead of clicking the one on the right? it works for me.

πŸ‘€jun

1πŸ‘

Source: https://windowsquestions.com/2020/10/04/cant-set-breakpoint-in-imported-module-visual-studio-community-2019-python-project/

Tools –> Options –> Python –> Debugging –> Check : β€œEnable debugging of the Python standard library”

0πŸ‘

You need to set "justMyCode": true in your debug configuration as this is third-party code which is excluded by default.

πŸ‘€Brett Cannon

0πŸ‘

If you work with Typescript, and have tsconfig.json file –> Try setting:

"sourceMap": true

That worked for me

Source Map

πŸ‘€Pavel

0πŸ‘

In addition to what was mentioned in https://stackoverflow.com/a/70917357/2475775 I had to

  1. Set "purpose": ["debug-test"] in launch.json to set which config was used.

    source: https://code.visualstudio.com/docs/python/debugging#_purpose

    Setting the option to debug-test, defines that the configuration should be used when debugging tests in VS Code.

  2. Delete .cpython-39-darwin.so files.

    One of the external libraries I was using had .cpython-39-darwin.so versions of the python files. I suspect these are compiled Python files and it was using them instead of the .py files, and thus not seeing the breakpoints. I deleted them with

    cd path/to/site-packages/problem-package/
    find . -name '*.so'  # to see if the files exist
    find . -name '*.so' -delete  # to delete the .so files
    

I was using VS Code 1.77.3 on OSX 13.3.1

πŸ‘€Holly

0πŸ‘

.NET Core Solution

In my case none of the solutions above worked. VSCode suggested to add this line to my launch.json inside the related config which fixed the issue.

"requireExactSource": false

Complete config:

    {
        "name": ".NET Core Attach",
        "type": "coreclr",
        "request": "attach",
        "requireExactSource": false
    }
πŸ‘€Reza Taba

0πŸ‘

What worked for me was:

  1. Rename file (package I try to debug has name like "pi.py" and in editor it showed "…pi.py is overriding the stdlib module" error. When I tried to debug pi.py straightly (not main file that imports "pi.py"), my breakpoints went greyed out, with message that it was turned off by filters. I copy content of "pi.py" to "pi2.py" file, and on this one breakpoints worked. Sounds like magic.
  2. Setting "justMyCode":false in launch.json

Also advice, given by MTex above is useful.

Leave a comment