gulp-concat-sourcemap icon indicating copy to clipboard operation
gulp-concat-sourcemap copied to clipboard

Do line numbers work correctly?

Open koistya opened this issue 11 years ago • 8 comments

It seems like line numbers correctly match only for the first file in a bundle.

For example, source files:

/src/normalize.css
/src/style.css

Output file:

/build/style.css

DevTools in Google Chrome opens ./src/normalize.css correctly, and ./src/style.css not (in my case, it opens line # 118, when it should be line # 5. etc.)

koistya avatar Jun 17 '14 18:06 koistya

Me too, the line numbers not correct.

yyfearth avatar Jun 27 '14 02:06 yyfearth

For me even file names are wrong.

yuri-karadzhov avatar Jul 01 '14 10:07 yuri-karadzhov

Yes, line numbers are wrong completely, also means filenames are wrong either. I copy the code and run directly using mozilla source-map, still completely wrong. So either source-map has bug or the way we use it was wrong.

yyfearth avatar Jul 01 '14 17:07 yyfearth

It looks like this is an issue with SourceNode in mozilla/source-map introduced in 0.1.34. It handles blank lines (ie. successive newline characters) badly. It's fixed by this commit (not yet released on npm): https://github.com/mozilla/source-map/commit/37da0497315028abf9a43014c630c0520310f471.

Here's the relevant bug: https://github.com/mozilla/source-map/pull/116

rianmcguire avatar Jul 03 '14 01:07 rianmcguire

Yes, thanks. I tried the older version of source-map, and it works.

yyfearth avatar Jul 03 '14 01:07 yyfearth

@rianmcguire I use chrome but still have this problem.

yuri-karadzhov avatar Jul 03 '14 07:07 yuri-karadzhov

Just released v1.3.1. Does it still actual?

mikach avatar Jul 07 '14 19:07 mikach

source-map updated to 0.1.37 seems solved the issue

yyfearth avatar Jul 13 '14 23:07 yyfearth