rbcodecraft / vscode-ts-node-debugging Goto Github PK
View Code? Open in Web Editor NEWDebugging Typescript in VS Code without compiling
Debugging Typescript in VS Code without compiling
Using the latest version of this repo, when I try to debug a test using the "Current TS Tests File" configuration, it doesn't hit breakpoints set in typescript.
VSCode info
Version 1.22.0-insider
Commit a716373aaaf50cbce3618688a645b324721b35dd
Date 2018-03-14T05:15:41.910Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
i installed tried to debug and
Attribute 'program' does not exist ('/home/xxx/test/vscode-ts-node-debugging/node_modules/mocha/bin/_mocha').
i wonder how i could make it work with a dockerfile like this
FROM node:9-alpine
ARG APP=/http
WORKDIR ${APP}
COPY . ${APP}/
RUN npm install
RUN npm i -g typescript ts-node [email protected]
EXPOSE 3000
RUN npm run debug
I am on Node 8.4 and VSCode 1.16 as stated in the README. When I try to open person.tests.ts
and invoke the 'Current TS Tests File' debug configuration, I get this error:
Cannot launch program 'c:\Temp\vscode-ts-node-debugging\node_modules.bin_mocha'; setting the 'outDir or outFiles' attribute might help.
I noticed that there's a backslash missing in the .bin_mocha
part (should be .bin\_mocha
) so maybe it's a Windows-only issue?
Debugging doesn't work.
I get this when trying to debug: «Configured debug type 'node' is not supported.»
Or other test runners in general? I'll look into myself, but it'd be great if you had an easy answer. Thanks!
I modify my launch.json
like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Current TS File",
"type": "node",
"request": "launch",
"args": [
"--nolazy",
"-r",
"ts-node/register",
"${relativeFile}"
],
"sourceMaps": true,
"cwd": "${workspaceFolder}"
}
]
}
It also works fine.
so, what's the difference between args
and runtimeArgs
?
I read official doc about debugging in vscode, did not find rumtimeArgs
and protocol
attributes.
https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
Cloned the repo, installed the packages, launched Current TS File
configuration -> Breakpoints are not hit when a file is open, neither when it's not currently open.
can't get this example working. I spent 6 hours on this.
Example there - https://github.com/gintsgints/workspaces/tree/master/packages/vscode-ts-node-debugging
When I start debugging in workspace - current test file - person.tests.ts, I get error message - Attribute 'program' does not exist '...../bin/_mocha
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.