brunch / brunch.github.io

The website
https://brunch.io
MIT License
113 stars 99 forks source link

'echo' command on Windows produces unusable js file. #263

Open decafbad opened 7 years ago

decafbad commented 7 years ago

When I followed quickstart and used 'echo' in Powershell: echo "console.log('Hello, world')" > app/logger.js

This new logger.js file cannot be used by brunch:

18:05:26 - error: Compiling of app/logger.js failed. Error: SyntaxError: app/logger.js: 
Unexpected character '�' (1:0)

   > 1 | ��c o n s o l e . l o g ( ' H e l l o ,   w o r l d ' )
       | ^
     2 |
     3 |
Stack trace was suppressed. Run with `LOGGY_STACKS=1` to see the trace.

Looks like a UTF-16 file with Byte Order Mark. http://i.imgur.com/9fF1i1b.png

shvaikalesh commented 7 years ago

Hey @decafbad, thanks for reporting & improving Brunch.

Indeed, Brunch should strip BOM. Will fix in 3.0.