Debug in IDE off on line numbers

I am using Webstorm and NG2 and Chrome to debug.  I have the Chrome extension and the app does break but the line numbers are not correct meaning it breaks a number of lines off. 

9 comments
Comment actions Permalink

To be clear I am using JavaScript Debug as the Debug config in Webstorm 

0
Comment actions Permalink

can you provide a sample project that shows up the issue?

0
Comment actions Permalink

maybe. My current project is not small.  

 

Before I do is there anything that might cause this?  I am thinking of moving to VStudio as I think it works for this in our project. Was trying to keep some of our team on Webstorm but maybe not possible 

0
Comment actions Permalink

I just can say that I'm not aware of any issues with out debugger that look related. Usually such problems are caused by inaccurate sourcemaps.

0
Comment actions Permalink

I believe it is sourcemap also but not sure how to fix. I added this 

 

new SourceMapDevToolPlugin({
test:/\.js$/,
moduleFilenameTemplate:'[absolute-resource-path]',
fallbackModuleFilenameTemplate:'[absolute-resource-path]?[hash]',
filename: "[file].map",
sourceRoot:'../src'}
),

 

https://github.com/dotCMS/core-web/blob/issue-10352-ng-site-browser/config/webpack.tomcat.js

0
Comment actions Permalink

Also FWIW this issues seems to happen because I am watching code using webpack but the  path: props.tomcatPath, points to my webserver.  

 

So the files get moved there as I watch.  Now wathcing or not is not working with the path set like this.  This seems to be the difference in when it works vs not. 

0
Comment actions Permalink

No, it's a different issue

0
Comment actions Permalink

It is three years too late, but if somebody steel has this problem.
The problem is in the different interpretation of line separators by IDE and compiler, which generates .map files.
For example on the windows in the WebStorm and Angular-Project - the TypeScript compiler ignores line separators, if they are Unix-Style (only LF).
In this case if code formatter transforms too long line to couple of shorter lines and splits these lines by only LF, then in .map file this originally single line will be interpreted as single line, but WebStorm displays by LF separated lines as different lines.

Solution - change line separator to CR+LF and problem will be solved!

P.S. I thin this is a bug in TypeScript compiler

0

Please sign in to leave a comment.