Google Chrome “Failed parsing SourceMap” : css.map (Web Essential)

帅比萌擦擦* 提交于 2019-12-18 10:43:21

问题


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.

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.

Any advice will be appreciated. Thank you in advance.


回答1:


Problem is that WebEssentials saves files in UTF8 with BOM, but Chrome is not able to open these files as .map files.

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

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.

I reported this on WebEssentials GitHub: Issue 1993

And there are some other reports:

  • Issue 1994
  • Issue 1977


来源:https://stackoverflow.com/questions/36133715/google-chrome-failed-parsing-sourcemap-css-map-web-essential

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