Search code examples
javascriptnode.jsminifyuglifyjs

Mysterious symbol which prevents js minification or may be error cause when compiling javascript


Resently I was just playing with wonderful UglifyJS when I noticed some strange symbol which gives me minification errors. It looks strange to me because I can't select or copy it and it is not any special character. At least I know (LF,CR,Tab or space).

In notepad++ it looks like this:

enter image description here

If I put cursor at the beggining of line 95 and press backspace picture becomes like this: enter image description here

I can delete it though. But I am curiuos. On the other hand I'd rather remove it by means of regex so to be sure these won't spoil my js files. So what is this and how can I find it and remove with regex or something?


Solution

  • Are you using Unicode BOM?

    The Uglifier may not be expecting BOM formatted files and it's treating the BOM as a character.