How to debug a typescript file containing Class on VS code?

Viewed 196

In VS Code, I am trying to debug (in Node.Js environment) a typescript file that contains a class. Although I have been able to debug a .ts file without having a class.

sample.ts

 class A {
    value: string;
    constructor() {
        this.value = "some_value";
    }
    print() {
        console.log(this.value)
    }
 }

 let v = new A();
 v.print();  

while trying to debug "sample.ts" the following error is showing

Process exited with code 1
Uncaught f:\TS\sample.ts:2
    value: string;
    

SyntaxError: Unexpected identifier
No debugger available, can not send 'variables'

SyntaxError: Unexpected identifier
    at wrapSafe (internal/modules/cjs/loader.js:1047:16)
    at Module._compile (internal/modules/cjs/loader.js:1097:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
0 Answers
Related