Currently, I'm attempting to troubleshoot the TypeScript code below using Visual Studio Code:
class Student {
fullname : string;
constructor(public firstname, public middleinitial, public lastname) {
this.fullname = firstname + " " + middleinitial + " " + lastname;
}
}
interface Person {
firstname: string;
lastname: string;
}
function greeter(person : Person) {
return "Hello, " + person.firstname + " " + person.lastname;
}
var user = new Student("Jane", "M.", "User");
console.log(greeter(user));
This section displays my launch.json set-up:
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "TypeScriptDebugTest",
// Type of configuration.
"type": "node",
// Workspace relative or absolute path to the program.
"program": "./HelloWorld.ts",
// Automatically stop program after launch.
"stopOnEntry": false,
// Command line arguments passed to the program.
"args": [],
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
"cwd": ".",
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
"runtimeExecutable": null,
// Optional arguments passed to the runtime executable.
"runtimeArgs": ["--nolazy"],
// Environment variables passed to the program.
"env": {
"NODE_ENV": "development"
},
// Use JavaScript source maps (if they exist).
"sourceMaps": true,
// If JavaScript source maps are enabled, the generated code is expected in this directory.
"outDir": "./built"
}
]
}
The compiled JavaScript files can be found in a folder named 'built' under the root directory. However, whenever I attempt to debug, I consistently encounter the following error message: "Cannot connect to runtime process(timeout after 5000ms)"
Just to clarify, I am looking to debug the .ts file directly, not the compiled javascript.
If anyone has any insights on resolving this issue, your help would be greatly appreciated!
Many Thanks!