-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Description
After using the fix for #960, if a debug session is launched for TypeScript file that resides within a subdirectory, the debugger is unable to find its corresponding JavaScript, even when the JavaScript has unambiguous source maps & a tsconfig.json file specifies the location of the JavaScript.
Steps to reproduce:
- Initialize a new directory with npm/yarn & a Typescript installation, and make an Eclipse project out of it.
- Write a
tsconfig.jsonthat includes at least"sourceMap": true&"outDir": "./<someOutPath>", and optionally"rootDir: "./<someSrcPath>". - Write a simple
*.tsfile in./<someSrcPath>and compile it withtsc(and make sure it picked up thetsconfig.jsonby checking that generated the*.jsfile is in./<someOutPath>). - Place a breakpoint on your
*.tsfile and debug it with Debug As > Node Application.
Results:
The debug session with fail with this error dialog:
Unexpected exception
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Cannot launch program '{path}' because corresponding JavaScript cannot be found.
Workarounds:
- Run the generated
*.jsfile withnode --inspect-brkin a terminal (or with External Tool Configurations > Program), and attach to it with Debug Configurations > Running Node.js application. - Move the
*.tsfile to the root directory of the project (and remove"rootDir"from thetsconfig.jsonif it was specified), the recompile & relaunch the debug session.
LucCappellaro
Metadata
Metadata
Assignees
Labels
No labels