How to debug typescript template CRA in VS Code #10290
              
                Unanswered
              
          
                  
                    
                      lvanderbijl
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I just created a new CRA (v4.0.1) using the typescript template.
All the npm scripts work and run without problems. I can run the 'test' script and it correctly runs all the tests in my project. However, I'm unable to get the debug to work in VS Code. I can see the tests run with a debugger attached, but the debugger never stops.
I'm pretty sure it's because I'm setting breakpoints on the typescript and the debugger is attached without sourcemaps to the js.
Can anyone help?
I'm using the recommended launch config:
{ "name": "Debug CRA Tests", "type": "node", "request": "launch", "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts", "args": [ "test", "--runInBand", "--no-cache", "--watchAll=false" ], "cwd": "${workspaceRoot}", "protocol": "inspector", "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "env": { "CI": "true" }, "disableOptimisticBPs": true }Beta Was this translation helpful? Give feedback.
All reactions