问题
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.
- Is a Source mapping done in FireFox Console?
- 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