Skip to content
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

async sourcemaps #2515

Closed
matthiasg opened this issue Oct 10, 2015 · 17 comments

Comments

Projects
None yet
8 participants
@matthiasg
Copy link

commented Oct 10, 2015

I was experimenting with async support in our project and while the implementation works the generated source maps are not really helpful i think. To me its seems they are jumping around without actually following the code . When i compare this to the source maps from https://github.com/MatAtBread/browserify-nodent i think the babel ones are lacking a little.

Does anybody else have the same issue ?

@sebmck

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2015

Are you asking whether or not source maps are buggy for regenerator compiled async functions or are you making a statement that they are? There should not be any problem with source maps.

@sebmck

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2015

Also FWIW I'd heavily recommend against using nodent. It gets the semantics very wrong and doesn't handle abrupt completions and iteration pausing very well.

@matthiasg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2015

Well for me the source maps are not working well at all. At first glance it looked ok, but stepping through often results in quite weird jumps that don't follow the steps all the time...

Thanks about the nodent feedback. Is there anything else nodent gets wrong other than what you mentioned?

----- Ursprüngliche Nachricht -----
Von: "Sebastian McKenzie" notifications@github.com
Gesendet: ‎11.‎10.‎2015 03:39
An: "babel/babel" babel@noreply.github.com
Cc: "matthiasg" mgt576@gmail.com
Betreff: Re: [babel] async sourcemaps (#2515)

BTW I'd heavily recommend against using nodent. It gets the semantics very wrong and doesn't handle abrupt completions and iteration pausing very well.

Reply to this email directly or view it on GitHub.

@lydell

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2015

@matthiasg Tip: Upload your source map to this online source map visualization, and share a link to it here. (There's even a CLI tool to help doing so.) That's a great way of finding source map problems.

@matthiasg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2015

@lydell thats a great tip, thanks .. the code in question is not (yet) open source so i cannot simply link this here but i will look at it and if required i could link an excerpt or so ...

@matthiasg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2015

@lydell i tried it with source-map-visualize but from the command line it doesnt work (lydell/source-map-visualize#2).

with the online tool its also not working well. on the left i see about two pages of script and on the right the entire remaining code but the moment i scroll down past the left two pages i dont get any highlights anymore.

i am not sure how this tool works anyway, when i cluck custom it asks me for the generated source file ... so i provide my compiled js file but then it doesnt ask me for the map file.. so how can i specify my map file anyway ?

then again i just realized that our gulp/babel/exorcist flow doesn't remove the //# sourceMappingUrl=data:application ... lines, maybe thats screwing it up

@matthiasg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2015

ok when i removed the superflous old sourcemap lines (the inline ones) it did behave better and ask me for the map file, sadly now it complains about '..\node_modules\browserify\lib_empty.js' missing just like in lydell/source-map-visualize#2

@lydell

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2015

As far as I remember the online visualizer never complains about missing source files, it merely asks you to upload them.

@matthiasg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2015

i found an error in my source (i renamed a file without renaming the appropriate import, tests where also failing, missed that).

@MatAtBread

This comment has been minimized.

Copy link

commented Oct 11, 2015

@sebmck - can you explain the semantic issues you're alluding to. Whereas the implementation is very different (syntax transformation as opposed to generators), I've tried to follow the syntactic and semantics of the spec, as far as I understand them.

@sebmck

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2015

Try it over all the tests here. await has the same semantics as yield in generators so using the technique that regenerator uses isn't so far out of the ordinary.

@MatAtBread

This comment has been minimized.

Copy link

commented Oct 11, 2015

Thanks - I'll take a look. FWIW, I fixed the yield/await and contextualized async issues you pointed out (I hope). I'll try against the tests and see what it throws up

@sebmck

This comment has been minimized.

Copy link
Contributor

commented Oct 13, 2015

Closing this issue as there's nothing actionable.

@sebmck sebmck closed this Oct 13, 2015

@danbucholtz

This comment has been minimized.

Copy link

commented Nov 6, 2015

@sebmck, I am seeing this issue as well. The sourcemaps are horrible with await/async and make it very tough to use the debugger due to all of the jumping around, wrong lines, etc.. Is there any way we can improve them?

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Sep 7, 2016

Comment originally made by @MikeMcElroy on 2015-11-21T20:31:37.000Z

Agreed - I see bizarre behavior with sourcemaps all the time. It's very distracting and difficult to follow when working with the Console in DevTools.


Comment originally made by Marjan Georgiev (marjan) on 2016-01-05T13:01:33.000Z

I have the same issue with debugger jumping after hitting an await line.


Comment originally made by @amcdnl on 2016-01-07T21:40:58.000Z

I think this might be related to the issue I reported: https://phabricator.babeljs.io/T6936

@talarari

This comment has been minimized.

Copy link

commented Feb 7, 2017

hey, any update on this?
source maps are incorrect so debugging doesn't work well, see
microsoft/vscode#19973

@kylezinter

This comment has been minimized.

Copy link

commented Mar 9, 2018

@kittens Why was this closed? Was looking into an issue with debugging Babel compiled code in VS code and they also mentioned that the source maps being generated around async/await are incorrect by Babel. Is there a spec of some sort for source maps around async/await somewhere that we can compare against to verify this? microsoft/vscode#45345

@lock lock bot added the outdated label Jun 8, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Jun 8, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.