-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"LESS: Unexpected token u" error when compiling LESS file with empty result #1696
Comments
This problem still occurs under Update 4. Adding an "important" comment as stated fixes it. Here's my file: @import "variables.less"; /* bug fix comment
*/ Interestingly, the first comment doesn't solve the problem, but the second one does. What makes the second comment "important"? Does Web Essentials see the "bug" as a keyword? |
Interestingly I had this very same issue without any imports. But just by adding the @charset "utf-8"; on the top of the file, I got rid of the error: Unrecognized token u. Also, we had an issue with the same project (not related to WE) today with a plain html file where the BOM was present in the file. Perhaps this issue is related to the Byte Order Mark? |
Also experiencing the issue. Mixins also do not generate any output and therefore throw the error. Adding @charset "utf-8"; does provide a temporary fix. |
I'm also experiencing the issue. For me this comment also works.
|
This is still a problem for me. I am using Web Essentials 2013 for Update 4. The workaround I use for now is to add @charset "utf-8"; |
Go to From inside the WebEssentials folder, open up the file map = JSON.parse(output.map); The problem is source map output may be the So... change line 65 to read: map = JSON.parse(output.map || "null"); And voilà; LESS compilation on files with empty output works again. |
@rjgotten Thanks!!! That was driving me crazy! |
@rjgotten That fixed it! Thanks! |
Is there a reason why this fix isn't included in the latest updates? Surely, if I was the developer I would want to include it the fix. The old comment workaround no longer works. For this to work correctly, you must restart visual studio after making the changes to the JavaScript file. I did so, but I hit upon this error JSON Schema: Couldn't parse System.String[] as a valid regex when I tried to use compile all less files. I went back and removed some of my old comment workarounds and when I saved it, it mysteriously worked. Is this the current state of software? Back in the old days, we didn't have a fraction of the tools and computing power we have today and software generally worked very well, even when written in assembly language. |
No, it's just Web Essentials falling flat on its face every other release due to a chronic shortage of proper unit tests on Visual Studio extension with a scope wide enough that it has begun to follow the god class anti-pattern. Web Essentials should be torn apart into smaller modules that can be invididually tested and individually updated. It's been mentioned before a few times... |
Thanks you @rjgotten, this fixed it for me too. I hope the Web Essentials team (@madskristensen) implements this fix with the next update. P.S. If anyone in the future is wondering, a restart of Visual Studio is required. At least for me it was. |
👍 @rjgotten's solution worked for me. This should really be implemented in the next update. |
👍 Looking forward for this fix! |
@rjgotten Thanks for the fix. This was a a really confusing error, but it's working fine thanks to you. Hoping this is fixed permanently in a future release! |
Why is this still not in the release version months later? :-( |
Unbelievable that this still hasn't been fixed. |
This may be related to Issue#1170 (which according to the comments has been fixed).
Recently updated to v2.5.3. When compiling a LESS file with no resulting CSS, a "LESS: Unexpected token u" error is given. I ran across this when making a change to the variables.less file of bootstrap. The file only contains variable definitions and is imported into other LESS files. This file no longer compiles.
As with Issue#1170, adding some element code (e.g.
body { cursor:auto; }
) to the file corrects the issue.I have also found that adding an 'important' comment (e.g.
/* bug fix comment */
) fixed the issue (I'm guessing because these comments are retained in the output).I'm working around the issue with the comment for now. But it would good to fix.
The text was updated successfully, but these errors were encountered: