谷歌浏览器“解析 SourceMap 失败”:css.map (Web Essential)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36133715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Google Chrome "Failed parsing SourceMap" : css.map (Web Essential)
提问by Md. Alim Ul Karim
Visual Studio 2013 UP5 + Web Essential's (v. 2.6.36) generated css.map files are invalid in "Google Chrome", however it is valid in "Firefox". Due to this it became impossible to debug less files in google chrome.
Visual Studio 2013 UP5 + Web Essential (v. 2.6.36) 生成的 css.map 文件在“Google Chrome”中无效,但在“Firefox”中有效。因此,在谷歌浏览器中调试更少的文件变得不可能。
Currently, I am using Web Essential 2.6.36 (+ Visual Studio 2013 Up5). I can disable the source map from google chrome's developer's setting. Which will remove those errors, however still we cannot debug less files and change the style. Which is a terrible problem.
目前,我使用的是 Web Essential 2.6.36(+ Visual Studio 2013 Up5)。我可以从 google chrome 的开发人员设置中禁用源地图。这将消除这些错误,但是我们仍然无法调试较少的文件并更改样式。这是一个可怕的问题。
Any advice will be appreciated. Thank you in advance.
任何建议将被认真考虑。先感谢您。
回答by PeterMacko
Problem is that WebEssentials saves files in UTF8 with BOM
, but Chrome is not able to open these files as .map
files.
问题在于,在WebEssentials保存文件UTF8 with BOM
,而Chrome是不能够打开这些文件的.map
文件。
As a temporary fix, you can go to your .map
file in Visual Studio and save it as a Unicode
(UTF-8 without signature) or US-ASCII
using
作为临时修复,您可以转到.map
Visual Studio 中的文件并将其另存为Unicode
(无签名的 UTF-8)或US-ASCII
使用
File -> Advanced Save Options -> Unicode (UTF-8 without signature) or US-ASCII.
It is possible that on changing the associated .css
file you will have to repeat this process. However, when I tested adding some rules to .css
the correct format was preserved for the .map
file.
在更改关联.css
文件时,您可能必须重复此过程。但是,当我测试时,将一些规则添加到文件.css
的正确格式中.map
。
I reported this on WebEssentials GitHub: Issue 1993
我在 WebEssentials GitHub 上报告了这个: 问题 1993
And there are some other reports:
还有一些其他的报道: