-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to debug (in Webstorm) with ts-babel-node #18
Comments
I've found the problem! Essentially source maps must be emitted inline for WebStorm to pick it up and act on breakpoints accordingly. Attaching them as comments made everything work, however this only solved the problem when using the require hook ( In order to also have this working using the #! /usr/bin/env node
'use strict';
require('..').registerBabel();
< require('ts-node/dist/_bin');
---
> require('ts-node/dist/bin'); I think (I've only quickly looked into why) this is because
Whereas for
By using I've not had much response from issues I've raised here (although I've been full-on for the past 2-3 days and appreciate you also may be busy), so I'm going to continue with my forked version for now. I'll try and write some tests and create a proper PR, I'll make a point of doing it sooner rather than later if I get a response |
Ignore half of that last comment. You can't use There may just have to be a limitation that for debugging, you must use node's |
- Removed inputSourceMap from babel and use merge-source-map to join TS and Babel maps - Accept TS source maps from either file comment or inline - Attach inline source maps to compile code to support debugging
- Removed inputSourceMap from babel and use merge-source-map to join TS and Babel maps - Accept TS source maps from either file comment or inline - Attach inline source maps to compile code to support debugging
- Removed inputSourceMap from babel and use merge-source-map to join TS and Babel maps - Attach inline source maps to compile code to support debugging
If I run
ts-node
I am able to use the Webstorm debugger however withts-babel-node
I'm not.I'm not sure what the issue is other than it's when
registerBabel()
is called. I thought it may have been an issue with how source-maps are configured but I've tried commenting theoverrideSourceMaps()
function but that doesn't help.In webstorm, I get the following output for ts-babel-node:
For ts-node, where the debugger works:
I've created a repo with details to reproduce, https://github.com/dan-j/ts-babel-node-debugger-issue. Note I'm using a forked version of ts-babel-node (which has a pull request open at the moment #16) but I've confirmed the debugger doesn't work in version 1.1.0 either (just 1.1.0 doesn't work with [email protected] and [email protected])
I've also tried with node v7.10.1, to no avail.
The text was updated successfully, but these errors were encountered: