-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
I can't get sourcemaps to work with nyc, babel and mocha #512
Comments
I did notice this in the sourceMaps documentation for babel
I wasn't sure what to make of that as I'm not using the CLI here. I'm requiring |
Ok, it seems to work when I use I have pushed this working configuration to https://github.com/pghalliday/nyc-babel-mocha-sourcemaps/tree/babel-plugin-istanbul |
@pghalliday was going to recommend using Having said this, using |
@pghalliday forgive me if I'm wrong, but it sounds like your issue has been resolved? Motion to close this issue? :) |
@JaKXz only in the sense that I worked around it by doing something else. As such I don't know if the original issue has been resolved. Also the workaround has some unpleasant side effects resulting in fragmentation of configuration (eg. excluding and including files for coverage in the babel configuration instead of the nyc configuration) |
In your WRT to fragmenting the configuration: that's a valid point, but I think of it as a separation of concerns actually. When instrumenting ES2015+ code the instrumentation itself is handed off to the babel plugin so that nyc becomes a glorified reporter. This makes sense to me since babel is going through all your code anyway, so in the Hope that helps. Let me know if anything I said is not resonating. |
Ok, but the issue is that source maps don't work without the plugin when they should. From the documentation it states that the plugin provides "better" support, specifically for better code highlighting in reports. AFAIK source maps are intended to work without the plugin, so the issue remains. |
@pghalliday we definitely seem to have some issues with sourcemaps; would love help debugging this -- maybe we can start getting some unit tests around some of the failing behavior over time. Let's leave this ticket open for motivation. |
I'm using a setup equivalent to what's described here. It used to work perfectly but as of version |
@paldepind when you have a second, please open a bug with a link to a specific repo having the issue. |
@paldepind I wonder if you were on https://gist.github.com/bcoe/0844b24c53cb81de703c091490034a23 let me know if I'm missing something. |
That is probably it. With Thank you for the help! |
closing in favor of #619. |
Here is an example of what I am trying to do https://github.com/pghalliday/nyc-babel-mocha-sourcemaps
If you checkout the project and run
Then you get the following output
Note that it reports the error as being thrown from
src/index.js:1:1185
even though the source file clearly throws on line 2I have installed
source-map-support
and set nyc to haveproduce-source-map
and babel to have"sourceMaps": "inline"
and mocha to--require source-map-support/register
(i tried moving that require to nyc too)Am I missing something or does this just not work. Thanks in advance
The text was updated successfully, but these errors were encountered: