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

bootstrap-fork.js sourcemap should not have the "sources" property #68805

Closed
roblourens opened this issue Feb 15, 2019 · 2 comments
Closed

bootstrap-fork.js sourcemap should not have the "sources" property #68805

roblourens opened this issue Feb 15, 2019 · 2 comments
Assignees
Labels
engineering VS Code - Build / issue tracking / etc.
Milestone

Comments

@roblourens
Copy link
Member

  • Debug an extension
  • Step into a console.log line
  • End up on a nonexistent line of the minified bootstrap-fork.js file

We are trying to debug the mapped lines of the minified file. The reason is that the sourcemap has "sources": ["bootstrap-fork.js"] so it points back at itself. It does have the source content inlined. So if it doesn’t have that property set then we would show the real source.

I assume we just throw all these js files into a minifier at some point. I think that whatever generates the sourcemaps is probably doing the right thing based on the info it has. Is it possible to post-process the sourcemaps that come out to patch this? I'm happy to investigate if someone can tell me where this happens.

cc @kieferrm

@joaomoreno joaomoreno added the engineering VS Code - Build / issue tracking / etc. label Feb 19, 2019
@joaomoreno
Copy link
Member

joaomoreno commented Feb 19, 2019

I'm happy to investigate if someone can tell me where this happens.

👏 The file goes through the build over here: https://github.com/Microsoft/vscode/blob/a3dc4be0e016ac65a7549f45af0ee85d547e01cf/build/gulpfile.vscode.js#L61

@joaomoreno joaomoreno added this to the Backlog milestone Feb 19, 2019
@roblourens
Copy link
Member Author

roblourens commented Feb 20, 2019

Thanks! I have a fix, not sure how far to go with it. I could apply this to all .js files that get minified. But it looks like bootstrap-fork.js is the only file that normal users might step into besides loader.js. loader.js is technically wrong too but its relative path gets screwed up another way and ends up called vs/vs/vs/loader.js so it works.

For now I'll just rename bootstrap-fork.js. It will look like this:
image

The sources property is required on the sourcemap so the only way around is to rename the source. I'm not even sure what the debug adapter should do here, it could compare the content of the file on disk to what's inlined in sourcesContent but I don't think that's practical.

sandy081 pushed a commit to vldmrkl/vscode that referenced this issue Feb 22, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering VS Code - Build / issue tracking / etc.
Projects
None yet
Development

No branches or pull requests

2 participants