简体   繁体   中英

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.

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.

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.
The issue recurs if the page and dev tools is open and press F5/Ctrl+R.
If focus in the address bar and press Enter, then work out.
Upd : works through time :(
Upd2 : I use 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). Then change the address in the bar, adding the client path, such as #123 ( http://localhost/myPage#123 ). Chrome will not reload the page, and routing at client will work. Breakpoint should be dependent on the client path url #123, logic must be different with or not this parameter. Some thing like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM