brunch.github.io icon indicating copy to clipboard operation
brunch.github.io copied to clipboard

'echo' command on Windows produces unusable js file.

Open decafbad opened this issue 8 years ago • 1 comments

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

decafbad avatar Apr 24 '17 15:04 decafbad

Hey @decafbad, thanks for reporting & improving Brunch.

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

shvaikalesh avatar Apr 24 '17 16:04 shvaikalesh