Console does not show event source from source map

偶尔善良 提交于 2019-12-12 17:19:26

问题


In FireFox I load my web application which has a Source Map. The Source Map seems to be loaded correctly, as the Debugger tab shows the original source files. However, the Console tab contains only links to the compiled code, instead of the Source Map code.

  1. Is a Source mapping done in FireFox Console?
  2. Do I have to enable anything?

Update: I also tried it in chrome and there the console shows the original location of the event, BUT: only the first time after starting chrome AND only, if I first load the page and then open the developer tools. Exactly same behaviour in opera (same engine...)

Update 2: As of Firefox bug 670002 Web console does still not support source mapping. In chrome the source mapping works more than once if I directly embed the source mapping instead of using an URL.


回答1:


For chrome developer tools, the answer was covered in this issue: https://bugs.chromium.org/p/chromium/issues/detail?id=633549

In some cases, developer tools requested the source map file when no connection was alive anymore. It tried to open a new connection, which failed silently because of an invalid ssl certificate.

You may run into this, when:

  • You serve using https
  • You do not have a valid ssl certificate (which may happen often when you just run a quick local node.js https server)
  • Your https server closes the connection fast or immediately

Especially when your https server sends connection:close in the response headers you may run into this.

The biggest issue is, that this request is not shown in the network tap nor in the console, it is just silent.



来源:https://stackoverflow.com/questions/37022024/console-does-not-show-event-source-from-source-map

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