-
-
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
Incorrect errors from less compilation #1170
Comments
Beware of relative paths. |
We have no path information at all in the less files. They are all contained in one folder (content). Are you suggesting the includes all need to be relative to the base of the project even if they are all contained in the same folder together (./content/my.less), or worse and use absolute paths (C:\Users\me\documents\project\content\my.less)? |
@kingmotley, we have recently overhauled the entire way of dealing with node-based services. Please upgrade to VS2013 Update 3 RC, which is the prerequisite for the latest nightly build v2.2.7. If this fixes the issue, please consider closing it. Thanks. |
Will take a look at it, but likely won't be able to revisit this until Update 3 Final is released. I don't have a test dev box set up, and I'm leery of installing Update 3 prior to a final release and we are in the middle of a small crunch time. |
Can reproduce with VS2013 Update 3 final release, using nightly build of Web Essentials. Same issue, as posted in screenshot below. Running VS2013 Update 2 with WE 2.2.6 worked well; I wanted to grab the nightly but realized 2.2.7 needed Update 3 RC and by the time I got around to updating VS2013 the full release was already out, then starting with WE 2.2.7 the compilation seems to break when you import a lot of files. For reference, 'reference.less' imports 3 files but compiles fine. |
Yessir, updated comment for clarity. |
Cool. Will take a look :) |
For reference, attached is a screenshot of a less @import heavy LESS file compiling correctly, VS2013 Update 3 WE 2.2.7 nightly build: |
@ehorodyski can you make a sample project so we can test? |
Give me a few moments to upload my source to GitHub. I'm much more familiar with TFS so it's taking longer than I had hoped. You will need many more files :-), also I have source mapping off. |
👍 |
Whew. I need to brush up on my GitHub 😳 |
Thanks. 👍 And I need to brush up my TFS concepts 😄 As I was suspecting, it turned out to be a syntax error: change this to: @import (reference) '../references/references.less'; and all the SASS compiler strictly consider @import <(optional modifier)> 'file-path-with-or-without-extension-enclosed-in-single-or-double-quotes' See imports in docs. HTH |
Wow. Excellent find. How utterly inconsistent since most of my files don't use |
Actually, we have a prebuild task, which fetches the latest node.js packages every time WE's code is compiled (after the user manually deletes Resources\nodejs folder, before the build). This way our services keep up to date. @SLaks, on that note, there are some packages with really long paths, PreBuild throws |
Guys v2.3 stable version is just released, check it out. @SLaks, thanks for the link. The exception is thrown at
When I type System.IO.L... it shows But at the same time, System.IO.LongPath* are unavailable when we try other files. Do you suggest to download and use BCL team's long path downloaded from CodePlex? |
You're seeing it in PreBuildTask.cs because it isn't part of the project, so IntelliSense does not filter on access levels. Calling it won't actually compile. You should use the one from CodePlex; you'll need to edit the csproj to make it referenced by the pre-build task. (do not add it as a reference using VS) |
You can also use https://github.com/peteraritchie/LongPath; I have not used either one. |
Seems most of the errors went away, but now we can't compile one of our less files any longer. It's an exact copy from here: https://github.com/neoziro/less-hidpi/blob/master/hidpi.less We also get many errors about not being able to find this file, which may be because it can't compile it any longer. Not sure. |
Apparently the problem isn't related to the content of the file. Creating even a brand new less file with nothing but "body{}" is returning the same error message: "8/8/2014 3:02:34 PM: LESS: test1.less compilation failed: LESS: Unexpected token u" |
Sounds like a UTF-8 issue with BOM. Try to save the .less file with UTF-8 without signature |
Maybe it is, but it's not coming from the LESS file. I've tried opening it in notepad, in textpad, saving in UTF-8, ANSI. Even creating a brand new less file does the same thing (right click on content folder, add, LESS stylesheet, type 'test2'). Get a window on left saying "body {}", window in right saying "/* Compilation Error occurred (see error list to navigate to the error location): */", and an output window below saying "8/8/2014 3:36:05 PM: LESS: test2.less compilation failed: LESS: Unexpected token u" |
Did you save it as "UTF-8 (without signature)"? |
Same issue to second co-workers machine that just upgraded to Update 3, WE for Update 3 just an hour ago. |
I assume it was trying to because when I click save's drop down, there is no option for without signature, just with encoding. And this isn't something we've done in the past. |
Yes, tried with "Unicode (UTF-8 without signature) - Codepage 65001", no effect. Uninstalling and reinstalled WE 2.3 also had no effect. |
The option is all the way at the bottom of the list almost. Not easy to find |
@am11 Do you have any idea what to do here? |
Uninstalled resharper 8.2 had no effect. |
Also, please disable source-map generation from LESS options under WE and try. Normally, its a JSON error: "Unexpected token u". |
Changing "Create source map files" and "Process source maps" for LESS to false had no effect. |
Not solution related either. Created a brand new solution, added a brand new LESS file, and it reports "8/8/2014 4:22:04 PM: LESS: test3.less compilation failed: LESS: Unexpected token u" |
@kingmotley: Hopefully you and your team aren't on such a short time squeeze. I have two steps that I always try:
|
Yeah, tried those. I'm spinning up a brand new dev box in Azure to see if it has the same issue |
We can diagnose the problem by injecting some old-fashioned Incidentally, are you getting this issue with other compilers (SASS, CoffeeScript, SweetJS, LiveScript) too? |
Not sure about the other compilers as we don't use them. The brand new dev instance did not seem to exhibit the same behavior. Thanks MS for including a prebuilt VS 2013 update 3 image by the way! |
Unfortunately, my time has run out. Will investigate more on Monday. |
@SLaks, thanks for the links. I tried the github one. Added it as a package. Now, its giving me error because I can't reference Pri.LongPath.dll as I tried copy the dll to Should we use Reflection instead? Admittedly, that would be very untidy workaround.. Is there a better way? |
Is that a compiler error or a runtime error? You may be able to make it work by calling |
Its the compile time error. I reverted the code changes, will try to reproduce and capture logs from fuslogvw. Yes; |
@SLaks, its fixed via am11@66a41d6. Just used reflection where it was causing the issue. |
Well after trying some more things, it appears that I'm getting the error message because there is no output. The code https://github.com/neoziro/less-hidpi/blob/master/hidpi.less and the default less file should produce a 0 byte css file but instead reports "8/11/2014 10:11:35 AM: LESS: test3.less compilation failed: LESS: Unexpected token u". As soon as I add a property to the body selector, it compiles correctly without an error message. |
Trying to track back where the error is coming from, it appears to come from the node server, but it appears WE is making requests to the node server trying to get something from the root, and the node server is failing as well. I see many of these requests come and get errors returned. Not sure if that is normal either.
|
When I compiled https://github.com/neoziro/less-hidpi/blob/master/hidpi.less with WE v2.3, it produces no css file and in output it says: |
That is normal; when |
No; that exception was from a request to |
Yes you are right; |
Ok, the problem goes away if I turn off the autoprefixer. So it appears it's a problem if you compile a LESS file that returns no results and you have the autoprefixer turned on. That should help track down what the issue is. The prefixer settings we are currently using is |
@kingmotley, it turned out to be a JSON parse issue. I am busy implementing another service; rtlcss and refactored that code (for sake of DRY). Can't say for sure if it has fixed your issue, but since it is narrowed down; fixing it should not be an issue. Nice catch BTW. 👍 |
With #1396, this issue is also fixed. The problem was with parson invalid JSON produced by autoprefixer. The piece of code which was responsible for that has been removed now (it was to strip @madskristensen, lets @kingmotley confirm it before this is closed. For that matter, should we have a nightly build at this point; v2.3.1? |
@kingmotley can you please test with v2.3.1 nightly to see if it's fixed? |
Tested with v2.3.3 nightly today, first rebuild threw a lot of errors about the rtlstuff. Building again was much cleaner. First build:
subsequent builds looked more like this:
|
Looks like the problem where the LESS file that produced no output was throwing the autoprefixer for a loop has been fixed. Still not sure why it appears that there is an issue with not finding 'hidpi.less' sometimes, or why it is recompiling the same files multiple times however. I'll close this topic and reopen another regarding those when I have a chance to simplify the conditions that causes them. |
We have a common less file that gets imported to many different less files, and we get strange errors when building. Such as:
6/9/2014 9:57:25 AM: LESS: tripstarterslincoln.less compiled.
6/9/2014 9:57:26 AM: LESS: tripstartersCulinary.less compiled.
6/9/2014 9:57:26 AM: LESS: traveldeals.responsive.less compiled.
6/9/2014 9:57:26 AM: LESS: tripstarterslincoln.less compilation failed: FileError: 'tripstartercommon.less' wasn't found
6/9/2014 9:57:26 AM: LESS: tripstartercommon.less compiled.
6/9/2014 9:57:26 AM: LESS: tripstarterschicago.less compiled.
6/9/2014 9:57:26 AM: LESS: tripstartersroute66.less compilation failed: FileError: 'tripstartercommon.less' wasn't found
6/9/2014 9:57:26 AM: LESS: tripstartersoutdoor.less compilation failed: FileError: 'tripstartercommon.less' wasn't found
6/9/2014 9:57:26 AM: LESS: tripstarterschicago.less compilation failed: FileError: 'tripstartercommon.less' wasn't found
6/9/2014 9:57:26 AM: LESS: tripstarterslgbt.less compilation failed: FileError: 'tripstartercommon.less' wasn't found
Notice that tripstarterslincoln.less compiled fine, then 3 lines later, it complains that it failed to compile because it couldn't find tripstartercommon.less, which it then finds and compiles on the very next line. Similar thing for tripstarterschicago.less, but in a different order.
The text was updated successfully, but these errors were encountered: