svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
448 stars 25 forks source link

How to use with Typescript? #87

Closed klavul closed 5 months ago

klavul commented 5 months ago

I've ran default dape-node config on hello world typescript file and got this error in dape-repl.

Debug server listening at ::1:42445
/usr/bin/node helloworld.ts
Uncaught SyntaxError /home/qeqpep/s/typescript-hello-world/helloworld.ts:1
let message: string = 'Hello World';
           ^

SyntaxError: Unexpected token ':'
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1274:20)
    at Module._compile (node:internal/modules/cjs/loader:1320:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at executeUserEntryPoint (node:internal/modules/run_main:128:12)
    at <anonymous> (node:internal/main/run_main_module:28:49)
Process exited with code 1

What do I need to make it work?

svaante commented 5 months ago

Hey, I needed to do some digging to figure this one out.

One way to do it is to install "ts-node" npm install --global ts-node

Then bild

Should probably add that as an default configuration

svaante commented 5 months ago

New batteris included on master `js-debug-ts-node' which makes the discoverability of typescript debugging a bit easier.

klavul commented 5 months ago

thanks!