Can't set breakpoint in source mapped file (example with jquery)

孤街醉人 提交于 2019-12-12 12:19:16

问题


I have a problem to set a breakpoint on a javascript source file minified mapped on real sources with a source map file.

The problem can be demonstrated with jquery.com website.

On this site, the imported script is jquery.min.js which contains a //# sourceMappingURL=jquery.js directive.

This can be observed on chromium 37 debugger :

On that "real source file", i'm trying to setup a breakpoint on line 500, bug the breakpoint appears on line 6955.

What is is wrong with this use case ? Is it possible to do this ?


回答1:


This could happen when the line you set breakpoint to does not have proper mapping to the compiled source code. I have checked and indeed this line is mapped to some weird (unexisiting) position in the jqeury.min.js file.

Consider filing this as a JQuery issue. Please note, however, that while in the most recent versions of jquery source map url is not included in the minified version by default, you can still download it from their site and check if this was fixed.



来源:https://stackoverflow.com/questions/26212796/cant-set-breakpoint-in-source-mapped-file-example-with-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!