rollup-plugin-sourcemaps icon indicating copy to clipboard operation
rollup-plugin-sourcemaps copied to clipboard

Multi stage SourceMap error lines are not accurate

Open prabhap opened this issue 10 years ago • 2 comments

I used rollup as suggested in the Angular2 website. It was not able to generate the sourcemap till the typescript files that i wrote for my app. Thankfully, the plugin is able to navigate till the original ts files. But, still when an error occurs, the line displayed in the console is not accurate, although it is somewhere very near the error. Also, I am unable to keep break points at the desired location. Following is my rollup config. Could you please help me for bringing up the right error line number and adding breakpoint at the desired location ?

`export default { entry: 'scripts/main.js', dest: 'build/bundle.js', // output a single application bundle sourceMap: true, format: 'iife', context: 'this', plugins: [ nodeResolve( { jsnext: true, module: true, } ), commonjs({ include: 'node_modules/**', }),

sourcemaps()

]

}`

prabhap avatar Nov 25 '16 17:11 prabhap

Same problem here. Line numbers are always a bit of. It's never more than a few lines, but the exact amount is not predictable.

christianhanne avatar Nov 29 '16 11:11 christianhanne

I'm pretty sure Chrome doesn't use the source maps to trace line numbers in errors back to the original source. Have you tried using https://github.com/evanw/node-source-map-support?

maxdavidson avatar Dec 03 '16 14:12 maxdavidson