-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors on byte order mark ASCII code 65279 #46
Comments
It would be better to explicitly check for & remove a BOM, and continue to fail on other invalid JSON. |
Hm. It is difficult question. If BOM is valid in JSON, you should create issue in JSON ;). If BOM is invaliad you should create issue in you prev map builder tool. How you generates map with BOM? |
No. BOMs are an artifact of the UTF8 encoding. |
I am using Autoprefixer which reads the source map in from a file that can begin with BOM. |
@tysonmatanich why your map contains BOM? What tool you use before Autoprefixer, which add BOM to map? |
Sass via Visual Studio Web Essentials. Might be a Windows thing. |
Good time to buy Mac :D |
@tysonmatanich without humor I recommend to create issue in Visual Studio Web Essentials. Of cource, we can fix it in PostCSS. But Web Essentials will still generate wrong maps and we will fix and fix all processors one by one. PostCSS fix will not fix the issue because other processors will fall too on this wrong map. |
@tysonmatanich, regardless of what node-sass does to map file, its definitely WebEssentials issue. WE does post-processing (especially to fix this libsass issue: sass/libsass#242) and write it back to map file. I think this is the issue with I have recently replaced all the occurrences of |
None of that is true; under ordinary circumstances, BOMs never appear in strings. The BOM is added when writing the strong back to bytes (on disk, when we save the modified JSON to a file) |
None of it? Well this is a WE's issue! ;) @tysonmatanich, just ignore the rest of my previous comment. This issue is fixed by am11/WebEssentials2013@3a86bb7 via madskristensen/WebEssentials2013#1096. No more BOM.. |
Thanks, I will give it a try. |
FileHelpers: Avoid BOM (postcss/postcss#46)
On line 87 of map-generator.coffee,
prev
can contain a byte order mark (ASCII code 65279) which causesJSON.parse(prev)
to fail.Updating to the following, which trims the string, fixes the issue:
JSON.parse(prev.substring(prev.indexOf("{"), prev.lastIndexOf("}") + 1))
The text was updated successfully, but these errors were encountered: