Skip to content

Debug points getting hit but no visual indication when debugging nodejs (mocha tests) #68616

Closed

Description

Issue Type: Bug

When I try to debug node js app I see execution stops at certain breakpoints which are set but vscode doesn't highlight that point.
Launch.json for debugging

{
            "type": "node",
            "request": "launch",
            "name": "Mocha All",
            "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
            "args": [
                "-r",
                "ts-node/register",
                "--timeout",
                "999999",
                "--colors",
                "${workspaceRoot}/test/**/*.test.ts"
            ],
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
            "protocol": "inspector",
            "env": {
                "NODE_CONFIG_DIR":"./src/config",
                "NODE_ENV": "test"
            }

VS Code version: Code 1.31.1 (1b8e830, 2019-02-12T02:16:38.656Z)
OS version: Darwin x64 17.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 3
Memory (System) 16.00GB (0.52GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (23)
Extension Author (truncated) Version
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
vscode-eslint dba 1.8.0
es7-react-js-snippets dsz 2.0.1
vscode-html-css ecm 0.2.0
flow-for-vscode flo 1.0.1
vscode-styled-components jpo 0.0.25
graphql-for-vscode kum 1.13.0
dotenv mik 1.0.1
vsliveshare ms- 0.3.1182
debugger-for-chrome msj 4.11.1
color-highlight nau 2.3.0
quicktype qui 12.0.46
java red 0.38.0
autoimport ste 1.5.3
vscode-java-debug vsc 0.16.0
vscode-java-dependency vsc 0.3.0
vscode-java-pack vsc 0.5.0
vscode-java-test vsc 0.14.0
vscode-maven vsc 0.14.2
vim vsc 1.0.8
vscode-wakatime Wak 1.2.5
vscode-import-cost wix 2.12.0

Activity

  1. changed the title [-]Debug points getting hit but no visual indication when debugging mocha[/-] [+]Debug points getting hit but no visual indication when debugging nodejs (mocha tests)[/+] on Feb 13, 2019
  2. added
    debugDebug viewlet, configurations, breakpoints, adapter issues
    info-neededIssue requires more information from poster
    on Feb 13, 2019
  3. weinand commented on Feb 13, 2019

    @weinand
    Contributor

    When this happens could you please open the "Dev Tools" with the "Toggle Developer Tools" action and see whether there are any errors in the console.

  4. Bilchuck commented on Feb 13, 2019

    @Bilchuck

    I have the same issue. I am debugging Nest js application and debugger works very strange after VS code update.
    My config:

    {
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      "version": "0.2.0",
      "configurations": [
        {
          "type": "node",
          "request": "launch",
          "name": "Debug Nest Framework",
          "args": ["${workspaceFolder}/server/src/main.ts"],
          "runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
          "sourceMaps": true,
          "cwd": "${workspaceRoot}",
          "protocol": "inspector",
          "envFile": "${workspaceFolder}/server/.env"
      }
      ]
    }
    
  5. weinand commented on Feb 13, 2019

    @weinand
    Contributor

    Anton Bilchuck (@Bilchuck) When this happens could you please open the "Dev Tools" with the "Toggle Developer Tools" action and see whether there are any errors in the console.

  6. ashelopukho commented on Feb 13, 2019

    @ashelopukho

    I have the same problem when trying to debug CRA (Create react app) via Chrome debug extension for VSCode. (just checked prev vscode version 1.30.2 - and it works without problems)

  7. Bilchuck commented on Feb 13, 2019

    @Bilchuck

    Andre Weinand (@weinand) There are no errors in console

  8. Bilchuck commented on Feb 13, 2019

    @Bilchuck

    Andre Weinand (@weinand)
    screen shot 2019-02-13 at 16 20 26
    When I enter the variable name to debug console for reading it's value it sends me from my .ts file to this javascript.
    Also, I don't have access to any local variables. So debugger is not working at all. It just stops the process and can be resumed.

  9. Bilchuck commented on Feb 13, 2019

    @Bilchuck

    Andre Weinand (@weinand) But I can use debugger port provided by VS code in chrome inspector and debug there without problems.
    Hope my comments will help you to fix the issue

  10. 23 remaining items

  11. isidorn commented on Feb 21, 2019

    @isidorn

    Andre Weinand (@weinand) thanks for the great repro steps

  12. added a commit that references this issue on Feb 22, 2019
    c8973aa
  13. weinand commented on Feb 24, 2019

    @weinand
    Contributor

    Isidor Nikolic (@isidorn) this needs to be verified for all issues resolved as duplicates (e.g. C++, PowerShell).
    Maybe we need a test-item...

  14. isidorn commented on Feb 25, 2019

    @isidorn

    The code is the same for all debug types, I would just like that we verify for one. So no test item needed.

  15. weinand commented on Feb 25, 2019

    @weinand
    Contributor

    Isidor Nikolic (@isidorn) sure, the fix is debug type independent (which is true for 99.9% of all VS Code fixes). The question is whether your fix really covers all issues we were seeing in different debuggers. This cannot be proved by just verifying for node-debug.

  16. isidorn commented on Feb 25, 2019

    @isidorn

    Andre Weinand (@weinand) I have removed the duplicate from those issues so they also get verified

  17. gombosg commented on Mar 2, 2019

    @gombosg

    I'm getting the same error when doing Jest tests with the VSCode extension. Problem is that by default when I click "debug" in the code lens, VSCode just auto attaches to the jest tester:

    cd /home/$USER/$PROJECT ; env "CI=vscode-jest-tests" /usr/bin/node --inspect-brk=45641 node_modules/jest/bin/jest.js --runInBand $FILE.test.ts --testNamePattern "should $DOSOMETHING" 
    

    It hits my breakpoints and clicking on the top stack frame entry does reveal the line. The top entry in the stack is greyed out by default.
    Can't seem to turn off smartStep for auto attach, and right click - toggle skipping this file in stack list doesn't work.

    EDIT: creating a manual debug config with smartStep off works.

    (VSCode 1.31.1)

  18. roblourens commented on Mar 3, 2019

    @roblourens
    Member

    Gergely Gombos (@gombosg) it's not fixed in 1.31. Please try in Insiders

  19. locked and limited conversation to collaborators on Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesimportantIssue identified as high-priorityrelease-notesRelease notes issuesverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions