Skip to content
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

UTF-8 w/ BOM + @mixin causes fatal parsing error #880

Closed
mattdistefano opened this issue Sep 26, 2016 · 4 comments
Closed

UTF-8 w/ BOM + @mixin causes fatal parsing error #880

mattdistefano opened this issue Sep 26, 2016 · 4 comments

Comments

@mattdistefano
Copy link

Demo repo here

Short version is that when you have a file encoded as UTF-8 w/ BOM that starts with @mixin, the CLI linter fails with a 1:1 error Please check validity of the block starting from line #1 Fatal.

UTF-8 w/out BOM works fine, as does UTF-8 w/ BOM without @mixin at the start.

Happens on OS X w/ node 6.2.0 and Windows 10 w/ node 5.8.0.

The gulp-sass-lint plugin actually works fine in all scenarios.

@mattdistefano
Copy link
Author

Actually, I'm noticing that UTF-8 w/ BOM also produces an incorrect "Property appears to be spelled incorrectly" error when there's a variable on the first line too. I added an example to the repo. Can open a separate issue for that if you want, though I assume the root cause is the same.

@DanPurdy
Copy link
Member

Thanks @mattdistefano will look into it.

Just a note that when you see a please check the validity message, that that error is actually thrown directly from the AST we use to parse your files Gonzales-pe Therefore this may not be a quick fix.

I'll look deeper though. 👍

@mattdistefano
Copy link
Author

Thanks!

I believe gulp internally strips the BOM, which is probably why the gulp plugin worked where the CLI tool didn't. So a quick fix maybe is to do the same when loading from the filesystem directly.

@DanPurdy
Copy link
Member

Yep, thats what I'm thinking too. There's a task around stripping front matter too for liquid/jekyll stylesheets too so i may incorporate it into all that.

I'll keep you updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants