简体   繁体   English

命中断点时,Sourcemap请求挂起。 有没有办法强制预加载?

[英]Sourcemap request pending when breakpoint is hit. Is there a way to force a preload?

I am debugging a minified angular module. 我正在调试一个缩小的角度模块。

I got an error: 我收到一个错误:

堆栈跟踪内部出错

I set my breakpoints on the sourcemap-deminified file (which are correctly generated) and I hit reload. 我在sourcemap-deminified文件(正确生成)上设置了断点,然后点击重新加载。

Surprisingly enough I end up hitting the breakpoint inside the non-human-readable minified file instead of the source-map translated ones. 令人惊讶的是,我最终在非人类可读的缩小文件中找到了断点而不是源映射翻译的文件。 Why is that? 这是为什么? Well the network tab showed a sad truth: 那么网络标签显示了一个可悲的事实:

具有待处理.map文件的网络选项卡

This is happening while the whole computation is stuck because of the breakpoint in the minified file. 由于缩小文件中的断点,整个计算被卡住时会发生这种情况。 So the request is locked in a pending status and Chrome has no idea how to map the minified file. 因此请求被锁定在待处理状态,Chrome无法知道如何映射缩小的文件。

Have someone already experienced this problem? 有人已经遇到过这个问题吗? What was your solution? 你的解决方案是什么?

I met with this issue. 我遇到了这个问题。 在此输入图像描述 Problem occur because Chrome does not caching the source map and trying to get it, but breakpoint prevent. 出现问题是因为Chrome没有缓存源地图并尝试获取它,但断点可以防止。
The issue recurs if the page and dev tools is open and press F5/Ctrl+R. 如果页面和开发工具已打开并按F5 / Ctrl + R,则会再次出现此问题。
If focus in the address bar and press Enter, then work out. 如果焦点在地址栏中并按Enter,则计算出来。
Upd : works through time :( 更新 :通过时间工作:(
Upd2 : I use angularjs + angular-route. Upd2 :我使用angularjs + angular-route。 I think i found a workaround: open a page, for example http://localhost/myPage , chrome load all necessary files (with source map). 我想我找到了一个解决方法:打开一个页面,例如http:// localhost / myPage ,chrome加载所有必需的文件(带源映射)。 Then change the address in the bar, adding the client path, such as #123 ( http://localhost/myPage#123 ). 然后更改栏中的地址,添加客户端路径,例如#123( http:// localhost / myPage#123 )。 Chrome will not reload the page, and routing at client will work. Chrome不会重新加载页面,客户端的路由也可以。 Breakpoint should be dependent on the client path url #123, logic must be different with or not this parameter. 断点应该依赖于客户端路径url#123,逻辑必须与此参数不同。 Some thing like this: 有点像这样:

if ($route.current.params.id){
  //real logic with breakpoint
  debugger;
}else{
  //nothing
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 断点当前不会被命中。 没有在JavaScript中为此文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in JavaScript 断点当前不会被击中。 没有加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded 断点当前不会被击中。已调试的进程已加载不同版本的脚本文件 - The breakpoint will not currently be hit. A different version of script file has been loaded by debugged process 重击时重新定位球。 HTML5 Canvas javascript - Reposition ball when hit. HTML5 Canvas javascript 断点当前不会被命中。 与2013 javascript相比,此文档未加载任何符号 - the breakpoint will not currently be hit. no symbols have been loaded for this document vs 2013 javascript 断点当前不会被命中。 Windows Phone 8.1 phonegap应用程序中没有为该文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in Windows Phone 8.1 phonegap apps 在devtools中命中断点时,是否有办法在javascript中搜索所有局部变量和全局变量中的值? - Is there a way to search all the local and global variables for a value in javascript when a breakpoint is hit in devtools? 当我有条件 `if (bool = true)` 时,永远不会命中 else 分支。 为什么? - When I have a condition `if (bool = true)`, the else branch is never hit. Why? 等价请求挂起时等待 - Wait when equivalent request is pending TypeScript 调试错误 - 当前未命中断点 - 使用特殊字符时 - TypeScript debug error - the breakpoint not currently be hit - when use special character
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM