简体   繁体   中英

visual studio code - node js error with typescript debug configuration

I'm using Visual studio code editor 0.5 version. My debug configuration file:

{
     "name": "Launch app",
     "type": "node",
     "program": "src/server/app.ts",
     "stopOnEntry": false,
     "sourceMaps": true,
     "outDir": "src/server/"
}

I have compiled all files, but when I run in debug, I get this error: 节点js错误

But if I set sourceMaps to false and program back to src/server/app.js it works and I get break point hit at my app.js. Is this is visual studio code bug?

Finally I found a mistake. I'm using gulp-typescript and gulp-sourcemaps plugins and gulp-sourcemaps generate different source maps compared to tsc compiler, this is why this error occured. I was able to fix it only by doing some hacks for gulp-sourcemaps plugin. But I still not sure if this is gulp-sourcemaps bug or visual studio code bug so I will try to register bug for vs code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM