meteor-velocity / source-map-support

Wrapper for npm package source-map-support
MIT License
0 stars 0 forks source link

breaks webpack-dev-server bundles with eval sourcemaps #1

Open jedwards1211 opened 9 years ago

jedwards1211 commented 9 years ago

The root cause may lie with the source-map-support npm package, but I'm unable to use velocity due to this, so I'm logging the issue here as well.

See: https://github.com/evanw/node-source-map-support/issues/108

ghost commented 9 years ago

source-map-support tries to retrieve the source maps for those files that start with webpack://. Is there a way to retrieve the source map of those files or should source-map-support just ignore those files?

The purpose of source-map-support is to show errors with stack traces that refer to the code lines of the original file, not the transpiled file.

jedwards1211 commented 9 years ago

Yes, I've used source-map-support in other projects as well. There might be a way to retrieve those files, but I think it would make the most sense for it to just ignore them if it can't, right? I still don't completely understand how it would prevent an eval containing a sourceMapURL from running though.

ghost commented 9 years ago

How do you know that the error has anything to do with the eval source maps, you refer to? Can you give me an example? In the screenshot that you have posted in evanw/node-source-map-support#108 I just see that XMLHttpRequest throws an uncaught error because it cannot retrieve the file.

jedwards1211 commented 9 years ago

I haven't gotten to the root of the issue, but I know I can get it to work if I either

sanjo:jasmine + devtool: 'source-map' works, and devtool: 'eval' without sanjo:jasmine works.

So something about the combination of devtool: 'eval' and sanjo:jasmine makes the modules inside my webpack bundle fail to run, and I'm pretty sure it has to do with source-map-support. I'll let you know if I figure out more details.

jedwards1211 commented 9 years ago

And I've managed to work around this for now by only Velocity package tests, so that when I'm running in dev mode, it's not present and I can use devtool: 'eval'.

ghost commented 9 years ago

Is there any major benefit of using devtool: 'eval' over devtool: 'source-map'? Meteor builds use separate source-map files.