I use the less compiler with node.js and I know there is an issue with the files encoded in UTF-8 with BOM. For this, this workaround works great:
data = data.replace(/^\uFEFF/, ''); // Strip potential BOM
However, when importing files, using @import statements still gives a syntax error on first line. Are there any way to work around this as well?
The BOM will be stripped in the next version of less.js – 1.3.1. You can also try it out on the github source pages.
https://github.com/cloudhead/less.js/commit/6696368eb351824f33dc0aac67143d8ea80a085a