When I open my TypeScript in Chrome debugger I see strange red dot at the first line. I believe it corresponds to unrendered symbol \ufeff (as popover says). There is no such symbol in the TS file when I open it in editor (e. g., Notepad++ with "show all symbols"). Where does this symbol e from?
This file also contains some lines colored in gray. It seems that I cannot insert breakpoint to that lines (e. g., line #17 on the picture). How can I get rid of it?
In FireFox all this issues are not presented. I have no strange symbol at the beginning of the file and I can insert breakpoint to lines which were grayed out in Chrome.
Update. I have found that \ufeff corresponds to BOM. It is likely generated by --emitBOM option of the TypeScript piler. Now can someone explain how can I remove this option? I can't find any reference to "tsc" in my project file when I open it in a text editor as well as I can't find any proper options in Visual Studio GUI (Web Express).
Update 2. I have learnt from this discussion that with help of \ufeff = BOM Chrome can indicate a developer that there is something wrong in the code. But the BOM appears even when I ment out all code in my file.
When I open my TypeScript in Chrome debugger I see strange red dot at the first line. I believe it corresponds to unrendered symbol \ufeff (as popover says). There is no such symbol in the TS file when I open it in editor (e. g., Notepad++ with "show all symbols"). Where does this symbol e from?
This file also contains some lines colored in gray. It seems that I cannot insert breakpoint to that lines (e. g., line #17 on the picture). How can I get rid of it?
In FireFox all this issues are not presented. I have no strange symbol at the beginning of the file and I can insert breakpoint to lines which were grayed out in Chrome.
Update. I have found that \ufeff corresponds to BOM. It is likely generated by --emitBOM option of the TypeScript piler. Now can someone explain how can I remove this option? I can't find any reference to "tsc" in my project file when I open it in a text editor as well as I can't find any proper options in Visual Studio GUI (Web Express).
Update 2. I have learnt from this discussion that with help of \ufeff = BOM Chrome can indicate a developer that there is something wrong in the code. But the BOM appears even when I ment out all code in my file.
Share Improve this question edited Jun 5, 2015 at 10:22 Hoborg asked Jun 5, 2015 at 9:50 HoborgHoborg 96112 silver badges21 bronze badges 4- 1 You might want to search up what U+FEFF is used for, which might provide some insight into why this happens. – Qantas 94 Heavy Commented Jun 5, 2015 at 9:53
- @Qantas94Heavy Thanks for the clue. I have updated the question. However I am still confused that this symbol (U+FEFF = BOM) is not presented in the file when I view it with text editor. – Hoborg Commented Jun 5, 2015 at 10:13
- @Qantas94Heavy Yes, I have looked at this page but didn't find anything connected with my problem. Do you mean some concrete section on this page? – Hoborg Commented Jun 5, 2015 at 10:26
- 1 @Qantas94Heavy update to your link: en.wikipedia/wiki/Byte_order_mark – d48 Commented Jan 10, 2017 at 21:23
2 Answers
Reset to default 3It seems that Chrome somehow doesn't like UTF-8 with BOM. And this is exactly an encoding which my instance of Visual Studio did save file in. I have switched the encoding to UTF-8 without BOM and the described problems have disappeared.
How to: corresponding StackOverflow question. In two words: 1) select desired encoding while saving via "Save as...", or 2) go to File/Advanced Save Options... and select the encoding for all files (you need to add this menu item if you have no one). The encoding is called "UTF-8 without signature".
When I open my TypeScript in Chrome debugger I see strange red dot at the first line. I believe it corresponds to unrendered symbol \ufeff
Yes this is the BOM as other answers have already pointed out. For 2:
This file also contains some lines colored in gray. It seems that I cannot insert breakpoint to that lines (e. g., line #17 on the picture). How can I get rid of it?
These are lines that are not there in the sourcemap. This is the way chrome dev tools show unmapped to generated JS source code. So you cannot place a breakpoint in here as the runtime doesn't know which JS corresponds to this TS.