madskristensen / WebEssentials2013

Visual Studio extension
http://vswebessentials.com
Other
945 stars 252 forks source link

compilation failed - Something went wrong reaching .... #1323

Closed zagros closed 10 years ago

zagros commented 10 years ago

Ever since yesterday's update we're getting this on all machines that updated the nightly build -- we can't compile any less or js files:

 7/17/2014 12:19:00 PM: LESS: Compiling home.less
 7/17/2014 12:19:02 PM: Something went wrong reaching: http://127.0.0.1:55577/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:19:06 PM: Something went wrong reaching: http://127.0.0.1:41282/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:19:06 PM: LESS: home.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:24:52 PM: LESS: Compiling home.less
 7/17/2014 12:24:55 PM: Something went wrong reaching: http://127.0.0.1:24381/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:24:58 PM: Something went wrong reaching: http://127.0.0.1:32955/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:24:58 PM: LESS: home.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:25:35 PM: LESS: Compiling home.less
 7/17/2014 12:25:36 PM: LESS: Compiling home.less
 7/17/2014 12:25:36 PM: LESS: Compiling home.less
 7/17/2014 12:25:38 PM: LESS: Compiling home.less
 7/17/2014 12:25:39 PM: LESS: Compiling home.less
 7/17/2014 12:25:39 PM: Something went wrong reaching: http://127.0.0.1:8639/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:39 PM: LESS: Compiling home.less
 7/17/2014 12:25:39 PM: Something went wrong reaching: http://127.0.0.1:62382/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:39 PM: LESS: home.less compilation failed: LESS: Unrecognised input
 7/17/2014 12:25:39 PM: LESS: home.less compilation failed: LESS: Unrecognised input
 7/17/2014 12:25:39 PM: LESS: home.less compilation failed: LESS: Unrecognised input
 7/17/2014 12:25:41 PM: LESS: home.less compilation failed: LESS: Unrecognised input
 7/17/2014 12:25:41 PM: LESS: home.less compilation failed: LESS: Unrecognised input
 7/17/2014 12:25:41 PM: LESS: home.less compilation failed: LESS: Unrecognised input
 7/17/2014 12:25:42 PM: LESS: Compiling home.less
 7/17/2014 12:25:42 PM: LESS: Compiling home.less
 7/17/2014 12:25:43 PM: LESS: Compiling home.less
 7/17/2014 12:25:44 PM: Something went wrong reaching: http://127.0.0.1:41334/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:47 PM: Something went wrong reaching: http://127.0.0.1:15693/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:48 PM: Something went wrong reaching: http://127.0.0.1:47416/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:48 PM: LESS: home.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:25:49 PM: Something went wrong reaching: http://127.0.0.1:46351/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:51 PM: Something went wrong reaching: http://127.0.0.1:41483/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:51 PM: LESS: home.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:25:53 PM: Something went wrong reaching: http://127.0.0.1:18185/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:25:53 PM: LESS: home.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:26:24 PM: Something went wrong reaching: http://127.0.0.1:34020/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Chome.css.map&sourceMapURL&strictMath&
 7/17/2014 12:26:24 PM: LESS: home.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:26:24 PM: Something went wrong reaching: http://127.0.0.1:34020/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Cstyles.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Cstyles.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Cstyles.css.map&sourceMapURL&strictMath&
 7/17/2014 12:26:24 PM: Something went wrong reaching: http://127.0.0.1:34020/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cvendors%5Cbootstrap-3.1.1%5Ccss%5Cbootstrap-glyphs.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cvendors%5Cbootstrap-3.1.1%5Ccss%5Cbootstrap-glyphs.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cvendors%5Cbootstrap-3.1.1%5Ccss%5Cbootstrap-glyphs.css.map&sourceMapURL&strictMath&
 7/17/2014 12:26:24 PM: Something went wrong reaching: http://127.0.0.1:34020/?service=LESS&sourceFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Cvars.less&targetFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Cvars.css&mapFileName=C:%5CSource%5CmyConnect%5CmyConnect%5CContent%5Cbljc%5Cvars.css.map&sourceMapURL&strictMath&
 7/17/2014 12:26:24 PM: LESS: styles.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:26:24 PM: LESS: vars.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
 7/17/2014 12:26:24 PM: LESS: bootstrap-glyphs.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
thedigitaldesign commented 10 years ago

I've run into the same issue. Anywhere I am importing other less files I cannot compile. But, if I write valid css it compiles just fine.

Compilation failed

@import "variables.less";

Compiles

body { background-color: #00f; }
zagros commented 10 years ago

I conquer as well. The @import line cripples my less , without it things work.

am11 commented 10 years ago

This is the same issue that is under discussion at the end of this thread https://github.com/madskristensen/WebEssentials2013/issues/381. And this is the same issue as https://github.com/madskristensen/WebEssentials2013/issues/1308 (I guess the OP implied that its working now).

As you can see I tried and unable to reproduce it with latest nightly ( of course version 2.2.6.1 )

My guess is, its due to one of two things:

I tried with these steps: https://github.com/madskristensen/WebEssentials2013/issues/381#issuecomment-48997534 and unable to reproduce this issue. I just got a new computer, fresh installed VS and WE 2.2.6.1, followed similar steps and no issue with bootstrap framework (even by putting the glue file in different folders, fixing the references).

Please state similar steps of reproduction or better yet a short sample project (with just a dummy content), which unfortunately nobody has deemed to provide. Web Essentials is a vast project, combining number of heterogeneous set of technologies and the infrastructure to streamline them. Its not feasible to rely on the guess work. Please do see the guidelines for reporting bugs.

Thanks in advance.

thedigitaldesign commented 10 years ago

I just did a fresh install of Web Essentials 2013 2.2 then updated to the nightly build and my issue is now cleared up.

Thanks!

blowsie commented 10 years ago

I too have this issue, but unfortunately doing a clean install of WebEssentials does not fix the issue for me.

I can confirm however, downloading and compiling the Bootstrap Source Less from Nuget appears to be working fine.

I'm trying to diagnose the issue but I'm not having much luck at the moment. Any other suggestions of things I cant try to fix?


Version 2.2 is working fine, Nightly 2.2.6.1 is not.

am11 commented 10 years ago

I too have this issue,

My question to you, as everyone else, is "which" issue? The issue is defined by steps of reproduction or a sample code/project.

As of my experience with this project, the tangible most solution came from detailed steps of reproduction. Here is what our contribution guidelines say:

A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report.

Yet all those currently opened LESS related issue reported are failed to provide any good feedback which anyone can work with.

Come on guys, nobody has asked for the code which violates your corporate's NDA. A sample 5-10 lines code so I can reproduce it on my system.

blowsie commented 10 years ago

@am11 Working on it, as you know I always try and provide as much information with my bugs as possible.

am11 commented 10 years ago

I am counting on your feedback :)

Thank you!

blowsie commented 10 years ago

I have made a sample project with only some less files.

They are bootstrap files, but have been modified. These compile without error in version 2.2 but not in 2.2.6.1 nightly.

Error:

21/07/2014 10:54:50: LESS: Compiling bootstrap.less
21/07/2014 10:54:53: Something went wrong reaching: http://127.0.0.1:44595/?service=LESS&sourceFileName=C:%5CUsers%5Csblowes%5CDocuments%5CVisual%20Studio%202013%5CProjects%5CweTest%5Ccss%5Cbootstrap3%5Cbootstrap.less&targetFileName=C:%5CUsers%5Csblowes%5CDocuments%5CVisual%20Studio%202013%5CProjects%5CweTest%5Ccss%5Cbootstrap3%5Cbootstrap.css&mapFileName=C:%5CUsers%5Csblowes%5CDocuments%5CVisual%20Studio%202013%5CProjects%5CweTest%5Ccss%5Cbootstrap3%5Cbootstrap.css.map&strictMath&
21/07/2014 10:54:56: Something went wrong reaching: http://127.0.0.1:49061/?service=LESS&sourceFileName=C:%5CUsers%5Csblowes%5CDocuments%5CVisual%20Studio%202013%5CProjects%5CweTest%5Ccss%5Cbootstrap3%5Cbootstrap.less&targetFileName=C:%5CUsers%5Csblowes%5CDocuments%5CVisual%20Studio%202013%5CProjects%5CweTest%5Ccss%5Cbootstrap3%5Cbootstrap.css&mapFileName=C:%5CUsers%5Csblowes%5CDocuments%5CVisual%20Studio%202013%5CProjects%5CweTest%5Ccss%5Cbootstrap3%5Cbootstrap.css.map&strictMath&
21/07/2014 10:54:56: LESS: bootstrap.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!

Unfortunately im struggling to narrow this down to just a few lines of code at the moment, but im trying :)

https://dl.dropboxusercontent.com/u/14037764/Development/github/webessentials/lessTest.zip

am11 commented 10 years ago

@blowsie, this compiled well on my machine without any issue. Also using 2.2.6.1 the released nightly one.

7/21/2014 1:01:09 PM: LESS: Compiling bootstrap.less 7/21/2014 1:01:11 PM: LESS: bootstrap.less compiled. 7/21/2014 1:01:13 PM: LESS: bootstrap.less compiled. 7/21/2014 1:01:24 PM: LESS: Compiling bootstrap.less 7/21/2014 1:01:25 PM: LESS: bootstrap.less compiled. 7/21/2014 1:03:15 PM: LESS: Compiling bootstrap.less 7/21/2014 1:03:16 PM: LESS: bootstrap.less compiled.

blowsie commented 10 years ago

The following code alone throws an error for me.

//== Typography
//
//## Font, line-height, and color for body text, headings, and more.
@font-family-sans-serif:  "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-family-serif:       Georgia, "Times New Roman", Times, serif;
@font-family-monospace:   Menlo, Monaco, Consolas, "Courier New", monospace;
@font-family-base:        @font-family-sans-serif;

@font-size-base:          13px;
@font-size-large:         ceil((@font-size-base * 1.25)); // ~18px
@font-size-small:         ceil((@font-size-base * 0.85)); // ~12px
@font-size-xsmall:        ceil((@font-size-base * 0.75)); // ~12px

// Throws an error
@font-size-h1:            floor(@font-size-base * 2.4); // ~36px
21/07/2014 11:05:55: LESS: Compiling variables.less
21/07/2014 11:05:56: LESS: variables.less compilation failed: LESS: null

It appears to be the @font-size-h1 line which seems to be breaking in this case.

am11 commented 10 years ago

Yes I am looking into null thing, it should be a verbose error.

Meanwhile, if you set Strict Math option to true, it will work fine. To change the settings: Tools > Options > Web Essentials > LESS > Strict Math.

blowsie commented 10 years ago

It was this Strict Math setting which resulted in the Something went wrong reaching: message to display.

Its compiling again now, thanks.

am11 commented 10 years ago

Oh thanks! I can reproduce it now; by disabling Strict Math. :smile:

blowsie commented 10 years ago

Great, glad I could be of some use, and thanks for pointing me in the right place.

Nicholas-Westby commented 10 years ago

For anybody else who happens across this, the fix for me was to delete my SUO file (my solution user file).

samjulien commented 10 years ago

I'm still having this issue (with SCSS) -- Nicholas-Westby, I don't see where I have a SUO file. Any ideas?

thedigitaldesign commented 10 years ago

.suo files are hidden. You will need to turn on show Hidden Items in your file explorer.

Nicholas-Westby commented 10 years ago

By the way, this still happens quite a bit. I periodically have to delete the SUO file (I thought it was a one time fix, but it keeps happening).

OzBob commented 10 years ago

I experience this intermittently, but invariably when I do multiple saves of LESS files that are referred to by a 'master.less' file with @import lines in it, where the Service=LESS http request is kicked off multiple times and there might be contention for writing to output to master.css file .....

Is it a Node server inside the Build process of Visual Studio?

It's as if the service is broken or stuck. Where are the logs for this "http://127.0.0.1:55577/?service=LESS&" service?

am11 commented 10 years ago

@OzBob, you can run the server in development mode and the logs shall be verbose on console. If this is a bug report, without tangible reproduction steps, its like finding needle in the haystack [1]...

zsmorris commented 10 years ago

This is definitely still an issue. WE was working fine one minute and just stopped compiling LESS the next. Deleting .sou file did not help. Multiple @import statements in 'master.less' file was working fine, until they weren't.

This issue needs to be reopened.

Any other suggestions on solutions would be welcome. I've got a week+ worth of LESS-based work to do and now my LESS compiler doesn't work.

Hate to say it, @OzBob, but in my experience anyway, this kind of persistent but hard to reproduce problem is usually the sign of a fundamental design flaw somewhere. I've been (trying) to use WE for a couple years now and run into issues like this all the time.

zsmorris commented 10 years ago

I found the cause of my instance of this issue. It was bad LESS in one of the dependencies for 'master.less'. I had to install and run http://koala-app.com/ to get a working LESS compiler. It told me the exact problem immediately.

That is the main design problem with WE in this and many other cases: It fails without accurate information that pinpoints the root cause.

Nicholas-Westby commented 10 years ago

@am11 I would be happy to paste some logs. How does one run the server in development mode?

By the way, I intentionally include a file at the top of most of my LESS files called "compile-prevent.less". It references a variable which does not exist. The in my global.less file, I include "compile-allow.less" (before anything else), which declares that variable. I did that to avoid extra CSS files cluttering up my solution (i.e., only the main file compiles when I save... the others fail intentionally).

Interestingly, I am only able to get the global.less file to fail (with the "Something went wrong reaching" message) at the moment with the strict math enabled. For your reference, here are the contents of compile-prevent.less:

// Uses special variable used to prevent files from compiling.
.prevent-compile
{
    background-color: @color-prevent-compile;
}

And here are the contents of compile-allow.less:

// Importing this file first allows files to compile.
@color-prevent-compile: rgb(0, 0, 0);

I agree with @zsmorris that the error message should have something to help track down any issues that the code may have (though, maybe "development mode" will help with that).

am11 commented 10 years ago

@zsmorris, we overhauled the node-based services and transparently relay all the issues reported by upstream services. All the services used are official NPMs.

You can certainly contribute to this open-source project by fixing code and/or reporting a detailed bug report with some code: See guidelines to reporting bugs for web essentials. Of course, first thing to mention would be which version of WE (nightly or stable) you are testing with and since so forth. As of now, the current nightly build is at 2.3.4.

In order to work with we-node-server in development mode, use:

# cmd
# first cd into WE install directory: 
# %appdata%\..\local\Microsoft\visualstudio\12.0\<some-encrypted-name>\Resources\nodejs

node tools\server\we-node-server --environment development --port 1234

Then use querystring with http://127.0.0.1:1234 keys that appear in output window's error log. The responses you will get would be in JSON (so make sure to change the response content-type to text, if you are using IE -- coz it will prompt to download JSON :S)

Edit:

%appdata%\..\local == %localappdata%
Nicholas-Westby commented 10 years ago

@am11 Can't seem to get it working. I'm getting "The server cannot start due to the insufficient or incorrect arguments. Exiting.." arguments-error

am11 commented 10 years ago

Oh the logic was inverted (it was then inspired by ROR's mongrel/thin servers). :smiley:

Use: node tools/server/we-node-server --port 1234 instead. Env switch should only be supplied for production environment.

Nicholas-Westby commented 10 years ago

Thanks, @am11 .

Seems like I still can't reproduce the issue at the moment. If I can, I'll let you know what development mode says. In the meantime, maybe somebody else who is having this issue can use development mode and post details.

OzBob commented 10 years ago

I'm not sure how to un-close this issue, so I'm lurking waiting for next time we get the error and then I'll raise a new Issue and include the verbose build logs.

am11 commented 10 years ago

@OzBob, a new issue would make sense. "Something went wrong" is a generic error (when less service doesn't return any error or terminates unexpectedly). Which means; the original-poster might not had the same issue you are having, so they might not be correlated..

This is why steps to reproduce errors are vital in these situations. This is just like saying "VS is crashing", which could be due to any/many reasons.

@Nicholas-Westby, the more easy way to test is by installing node.js in your system, restart & in cmd, run:

node install -g less

This will install less.

Afterwards, you can test your less files by this command line compiler: less <parameters> absFilename(with-path).less.

It will register "less" in environment variable; available as a command-line tool.

mikechamberlain commented 10 years ago

I had this issue ("Something went wrong reaching..."), and had to resort to manually compiling the file outside of VS to see what the error was. It turned out to usage of a variable out of the scope in which it was declared.

The method in the above comment didn't work for me (Windows 8.1). The correct steps are:

npm install -g less

lessc myfile.less

markadrake commented 10 years ago

Forgive me - I've read through the comments here a few times to try and understand what you guys are discussing but haven't been able to make sense of this.

Background: I'm having this same issue in VS2013. I'm using the nightly build of Web Essentials, and it's up to date as of this posting. I'm also working through TFS.

When I first open a project - compiling SCSS works great. I have no errors or problems. If I go to work on some other files, do a check-in, it seems to be "any tasks not related to web essentials" - the next time I go to work with my SCSS files it will not compile (error copied below).

The files compile just fine - there are no syntax errors. When this happens I simply close VS, open VS, and compile - and it works just fine.

Question - Why does web essentials call 127.0.0.1:random-port-here? I'm not running an IIS Express site, I have this building to a physical directory on my computer where an IIS website has been setup. Shouldn't it reference the server settings in my project files? You should not be opening up a random port on my computer - respectfully.

My guess is somehow the file is now locked and is not being unlocked, checked out, whatever. But I lack the background in working in software development, Visual Studio, and TFS, to figure out exactly what is happening at the occurrence of this problem.

9/25/2014 11:52:58 AM: Something went wrong reaching: http://127.0.0.1:36568/?service=SCSS&sourceFileName=PATH 9/25/2014 11:52:59 AM: SCSS: main.scss compilation failed: The service failed to respond to this request Possible cause: Syntax Error!

Nicholas-Westby commented 10 years ago

@markusdrake Node.js has the ability to act as a web server. I believe what Web Essentials is doing is interacting with Node as a web server to get it to do certain things (things such as compiling LESS and SCSS files). My guess is that the port number is randomly generated each time Web Essentials interacts with Node and that the query string gives Node the info it needs to perform its tasks (such as compilation).

am11 commented 10 years ago

@markusdrake,

Can you share some code, which gives you this error? It seems to be the problem with the SCSS code. WE is supposed to checkout the files for you from source control. Node-services are not responsible for generating files. WE do the file writing. For reading the files (which node-services of WE do in this situation), checkout is not necessary (though I am not sure does TFS let you read the locked files or deny that too?).

With sample code, we can rule out any syntax problem and narrow it down to checkout related issue. @Nicholas-Westby is right; WE start we-node-server for every instance of WE. See https://github.com/madskristensen/WebEssentials2013/issues/381 to know how it transpired (and how we were dealing it before).

Once again; "Something went wrong.." could happen due to multiple reasons. It's is a fallback error message: unknown error.

markadrake commented 10 years ago

@AM11 and @Nicholas-Westby thanks for replying back.

My project has a lot of proprietary stuff in it, but give me a day or so to find the time to pull just the CSS out. I want to make sure the project is also in TFS, and that I can reproduce. I'll post back here with a link to the file or an update soon.

Nicholas-Westby commented 10 years ago

@am11 Just encountered the issue again. I ran we-nodejs-server without any errors, but I am still seeing errors in my build output in Visual Studio. Interestingly, I sometimes see that saving a file will try to compile that file and other times saving a file will try to compile both that file and the global.less file (the failure happening in both scenarios). For example, when I saved "text-styles.less", I got this output (I cleared my debug output before copying this to be sure I didn't get output from a previous save):

9/29/2014 4:37:26 PM: LESS: Compiling text-styles.less
9/29/2014 4:37:27 PM: Something went wrong reaching: http://127.0.0.1:29670/?service=LESS&sourceFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5CGeneral%5Ctext-styles.less&targetFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5CGeneral%5Ctext-styles.css&mapFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5CGeneral%5Ctext-styles.css.map&
9/29/2014 4:37:28 PM: Something went wrong reaching: http://127.0.0.1:29670/?service=LESS&sourceFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5CGeneral%5Ctext-styles.less&targetFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5CGeneral%5Ctext-styles.css&mapFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5CGeneral%5Ctext-styles.css.map&
9/29/2014 4:37:28 PM: LESS: text-styles.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!
9/29/2014 4:37:29 PM: Something went wrong reaching: http://127.0.0.1:29670/?service=LESS&sourceFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5Cglobal.less&targetFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5Cglobal.css&mapFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5Cglobal.css.map&
9/29/2014 4:37:30 PM: Something went wrong reaching: http://127.0.0.1:29670/?service=LESS&sourceFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5Cglobal.less&targetFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5Cglobal.css&mapFileName=C:%5CRepos%5Cmywebsite.com%5Cbb.web%5CCss%5Cglobal.css.map&
9/29/2014 4:37:30 PM: LESS: global.less compilation failed: The service failed to respond to this request
            Possible cause: Syntax Error!

Note that I also get the error when I save "global.less" (i.e., I get the error when I save a file that is valid).

am11 commented 10 years ago

@Nicholas-Westby, which version of web essentials are you running? The latest 2,3,4,1 had a regression with chained compilation, which is fixed. Please upgrade to latest nightly and apply the hotfix (see commit history). Also, are RTLCSS and Autoprefixer enabled?

Nicholas-Westby commented 10 years ago

@am11 I am on the latest release version (2.3). If there is a fix in the pipeline, I'll wait for another release version before I upgrade. "Enable Autoprefixer" is set to false. I couldn't find a setting called "RTLCSS".

am11 commented 10 years ago

RTL settings are at the end of CSS settings page.

Nicholas-Westby commented 10 years ago

@am11 I still don't see RTL settings: web-essentials-css-pane

am11 commented 10 years ago

Oh I keep forgetting, it was added after 2.3 (stable) in nightly build. Sorry for the confusion..

OzBob commented 10 years ago

@markusdrake @Nicholas-Westby you guys are the closest to replicating this error. Can you please run with @am11's suggestion of running Node in Developer mode. I'm not sure if the random port chosen by the Less Complier during the message is needed instead of the below 1234... cmd

first cd into WebEssential install directory:

%appdata%..\local == %localappdata% %appdata%..\local\Microsoft\visualstudio\12.0\Resources\nodejs node tools\server\we-node-server --environment development --port 1234

Then use LESS complie message in output window's error log as a querystring in IE on http://127.0.0.1:1234

Nicholas-Westby commented 10 years ago

@OzBob As I mentioned above, I already ran Node in developer mode: message

niklasHagner commented 10 years ago

Our dev team encounter this problem on a regular basis (several times per month) and we're not using Node.js in any way. But we've been able to solve it by simply restarting Visual Studio and rebuilding the solution. (using VS 2013 version 3 with Web Essentials version 2.3)

blowsie commented 10 years ago

@niklasHagner WE uses node behind the scenes

soatley commented 10 years ago

I've found that it seems to just be the Node server decides to no longer respond. Using the instructions above, I've just created a batch file to start node and run on the port that Visual Studio wants it to be on. Whenever you run into problems, just run the batch file and it will start node and continue to compile.

Icestorm0141 commented 10 years ago

@soatley do you have link or instructions on how to do that? I've been having the problem over and over again. Finally figured out how to use node.js to manually compile my less files but that seem rather stupid to me as WE should handle this automatically

am11 commented 10 years ago

@soatley, @Icestorm0141,

Given you are using WE v2.3.5, this code is responsible to resurrect node http server: NodeServer.cs#L23-L46 (in current master, it lives in ServerBase.cs, with @davidtme's ruby-sass-server inclusion: https://github.com/madskristensen/WebEssentials2013/commit/87bd5c3a617f64a91ab489c60d942e3933a244db).

What do you think is going wrong with that code? In my work environment, we use WE (v2.3.5) on every system. We use LESS in all projects and I haven't heard of this issue from anyone there yet.

The logic is simple, before making any request, we call NodeServer.Up().

@davidtme, you have also worked with that code. Can you think of any reason why the upstream wouldn't report back to WE.

/cc @SLaks

soatley commented 10 years ago

Here's my batchfile, but all the info is above in the comments that you'll need. You'll just have to customize it to the specific location of your WE install.

@echo off
c:
cd \Users\<insert your username>\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\<some-encrypted-name>\Resources\nodejs
node tools\server\we-nodejs-server --port <insert port number from VS output messages>
am11 commented 10 years ago

cd \Users\<insert your username>\AppData\Local\Microsoft\..

Or you can replace it with cd %localappdata%\Microsoft\.. :smile: