Can’t debug current typescript file in VS Code because corresponding JavaScript cannot be found

The problem may be with your map files and not with configuration.

Before trying anything else you want to make sure your paths that you are using in your launch configuration are correct.

You can do so by substituting the paths with absolute paths on your system temporarily to see if it works.

If it does not work you should:

Check your tsconfig and make sure mapRoot under compilerOptions is not set to anything. This is what official documentation has to say about it:

Specifies the location where debugger should locate map files instead
of generated locations. Use this flag if the .map files will be
located at run-time in a different location than the .js files. The
location specified will be embedded in the sourceMap to direct the
debugger where the map files will be located.

You can read more about it here

In most of the cases, you don’t really want to set it to anything.

Also, make sure that

"sourceMap": true`

is set in compilerOptions in tsconfig.json and map files are getting generated.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)