29

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. Failed parsing SourceMap : css map files

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.

Google Chrome Developers tools: disable source map parse

Any advice will be appreciated. Thank you in advance.

Md. Alim Ul Karim
  • 2,401
  • 2
  • 27
  • 36

1 Answers1

50

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:

bPratik
  • 6,894
  • 4
  • 36
  • 67
PeterMacko
  • 882
  • 1
  • 10
  • 15
  • if you want fix to this issue please star Google Chrome issue report: https://bugs.chromium.org/p/chromium/issues/detail?id=611328. This issue reports problem with files encoded by UTF8 with BOM. – PeterMacko May 16 '16 at 19:55
  • Also worked for me if I used Unicode (UTF-8 WITH signature) – Remy Jul 26 '16 at 14:13
  • 1
    It looks like the Chrome issue has just been recently released in version 52 and this is resolved now. – Matt Scully Jul 28 '16 at 20:11
  • 1
    I'm on Chrome 53 and getting this error with bootstrap.css.map and neither saving as UTF-8 without signature nor US-ASCII seemed to make the error go away. Admittingly, I have no idea what a map file is or why it matters to me. I see no issue with the user experience. – JDPeckham Oct 05 '16 at 15:03