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.

Should it debug typescript files ?

See original GitHub issue

I try too debug my jest test’s but its writen in typescript and with this js debugger it didnt run. Just stays with 2,9mb ram in the taskmanager and didnt say debugger atteched.

Without this extension the default debugger works. (no changes at the launch config)

Current launch config:


        {
            "name": "Debug Jest Tests",
            "type": "node",
            "request": "launch",
            "runtimeArgs": [
                "--inspect-brk",
                "${workspaceRoot}/node_modules/jest/bin/jest.js",
                "-i",
                "--runInBand"
            ],
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
            "port": 9229
        }

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
connor4312commented, Jan 9, 2020

Thanks for adding me!

Adjusting your launch config to remove the --inspect flags makes it work–this new debugger boots into inspect mode a little different, and --inspect interferes with that. I think adding a change in this extension to strip out manually-added --inspect flags is appropriate.

Also, fun fact, you no longer need to --runInBand with this adapter, we can automatically attach to and debug in all spawned children 🙂 However right now workers where BPs get hit can run a little slower, so you may want to keep it around.

This launch config should work for you. There are two further issues that will be fixed in tonight’s 5PM PST build:

  1. You couldn’t previously use pauseForSourceMap: false for transpiled code. We also default pauseForSourceMap to false for Node code, since it will run off disk and we don’t need the instrumentation BP which slows things down significantly in the few cases (like Jest) where it can be turned on.
  2. Jest will sometimes break in unexpected locations
        {
            "name": "Debug Jest Tests",
            "type": "pwa-node",
            "request": "launch",
            "trace": true,
            "runtimeArgs": [
                "${workspaceRoot}/node_modules/jest/bin/jest.js",
            ],
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
        }
0reactions
alexr00commented, Jan 31, 2020

Verified this bug, but the package.json code lens left out the npm part of npm react-scripts test and just tried to run react-scripts test. Bug for that https://github.com/microsoft/vscode-js-debug/issues/287

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to debug typescript files in visual studio code
1.) Debug current file without launch.json ... Just open or re-focus the file and then press F5 (Start Debugging). If multiple debug environments...
Read more >
Running and debugging TypeScript | WebStorm Documentation
If you typed the filename explicitly, select the file in the Project tool window or open it in the editor and then select...
Read more >
How to Debug TypeScript Files with Chrome Browser - Medium
This is a really useful way to debug TypeScript files, and it isn't difficult at all, let's debug TypeScript files and find bugs!...
Read more >
TypeScript Debugging Inside VSCode
TypeScript Debugging : Debugging Using VSCode Debugger & Debugging Inside Chrome. ... why would we bother ourselves with the “configuration files” and debug...
Read more >
Debug a JavaScript or TypeScript app - Visual Studio (Windows)
Debug server-side script · With your project open in Visual Studio, open a server-side JavaScript file (such as server. · To run your...
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