question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to debug with vscode?

See original GitHub issue

I added ts-jest to my project and the tests work fine (thx for that by the way! 😀 )

Unfortunately, I cannot properly debug the tests in vscode. I added the following launch config:

    {
      "name": "Tests",
      "type": "node",
      "request": "launch",
      "program": "${workspaceRoot}/node_modules/jest-cli/bin/jest.js",
      "stopOnEntry": false,
      "args": ["--runInBand", "--no-cache"],
      "cwd": "${workspaceRoot}",
      "preLaunchTask": null,
      "runtimeExecutable": null,
      "runtimeArgs": [
          "--nolazy"
      ],
      "env": {
          "NODE_ENV": "development"
      },
      "console": "internalConsole",
      "sourceMaps": true,
      "outDir": "${workspaceRoot}/dist/"
    },

I can run this config but vscode ignores all breakpoints. It complains:

Breakpoint ignored because generated code not found (source map problem?).

Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
mtillercommented, Jan 22, 2019

OK, I just wanted to add a point to this discussion. I just added the “Jest” (v2.9.2) extension in vs-code and basically it takes care of everything. If you can run Jest, it will do the rest. If you go to the debugger section, it will add a special configuration for debugging Jest tests. Worked the first try for me. Really awesome work. So if you want to combine Jest, ts-jest, vscode and the debugger, this seems like the simplest route!

7reactions
LukasBombachcommented, Sep 9, 2019

Also a quick note, you have to turn of coverage collection or your source maps will break

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging in Visual Studio Code
To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS...
Read more >
Introduction to Debugging in Visual Studio Code
Debugging is a core feature of Visual Studio Code. In this tutorial, we will show you how to run and debug a program...
Read more >
Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
Debugger Extension - Visual Studio Code
Visual Studio Code's debugging architecture allows extension authors to easily integrate existing debuggers into VS Code, while having a common user ...
Read more >
VS Code - Debugging - YouTube
In this video we demonstrate the basics of debugging a Node.js app.You can download VS Code at https://code.visualstudio.com.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found