question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem parsing Windows line endings

See original GitHub issue

See attached test case (sorry about the ZIP, Github doesn’t support .scss directly): test.zip

On Windows, files with multiple lines can’t be parsed by scss-parser.

" (1:16)d rejection Error: Can't handle character: "
    at InputStream.err (C:\myproject\node_modules\scss-parser\dist\input-stream.js:122:13)
    at Object.err (C:\myproject\node_modules\scss-parser\dist\input-stream.js:161:20)
    at TokenStream.err (C:\myproject\node_modules\scss-parser\dist\token-stream.js:297:40)
    at TokenStream.read_next (C:\myproject\node_modules\scss-parser\dist\token-stream.js:352:12)
    at TokenStream.peek (C:\myproject\node_modules\scss-parser\dist\token-stream.js:248:26)
    at TokenStream.eof (C:\myproject\node_modules\scss-parser\dist\token-stream.js:282:26)
    at Object.eof (C:\myproject\node_modules\scss-parser\dist\token-stream.js:631:16)
    at Parser.parse_stylesheet (C:\myproject\node_modules\scss-parser\dist\parse.js:266:27)
    at module.exports (C:\myproject\node_modules\scss-parser\dist\parse.js:748:17)
    at parse (C:\myproject\node_modules\scss-parser\dist\index.js:27:10)
    at parseDeclarations (C:\myproject\node_modules\sass-extract\lib\parse.js:131:35)
    at processFile (C:\myproject\node_modules\sass-extract\lib\process.js:25:51)
    at C:\myproject\node_modules\sass-extract\lib\process.js:58:29
    at Array.map (<anonymous>)
    at processFiles (C:\myproject\node_modules\sass-extract\lib\process.js:57:22)
    at C:\myproject\node_modules\sass-extract\lib\extract.js:126:49

If I convert the line endings to lf with eol it works correctly.

I tried passing the linefeed option in to render options, but it didn’t seem to have any effect.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jgranstromcommented, Sep 26, 2017

@JoshSchreuder thank you for the report. I will add additional test cases for Windows and a fix for the line endings in the next patch, probably before this weekend.

0reactions
jgranstromcommented, Dec 2, 2017

@JoshSchreuder @Saturate the latest 2.0.0 release should take care of the mentioned compatibility issues. The automated tests for windows are showing green light for both unix and windows style line endings. Please get back to me if there’s still any issues on the windows platform. Thank you for the detailed report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parsing does not work on Windows with CRLF line endings #2
The parse contents function only splits the content with \n---\n, so when creating posts on a windows machine which defaults to CRLF, this...
Read more >
With FParsec how would I parse: line ending in newline <|>
I've tried constructing an endOfInput rule and joining it with a skipLine rule via <|> . This is all wrapped in a many...
Read more >
Input file contains Windows(DOS) line endings which are not ...
I got an input file from someone else (see attached). The problem when running it (no matter which app) is as below. I...
Read more >
Diff of files is impossible to read when Ctrl+M is used as line ...
We've run into this issue as well but in our case the line endings are a mix of Windows and Unix. Both the...
Read more >
Fixing misaligned Linux and Windows line endings
Windows and Linux line endings don't match, which causes trouble if you're moving files from a Windows desktop to a Linux container.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found