Skip to content
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

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

Closed
zagros opened this issue Jul 17, 2014 · 70 comments
Closed

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

zagros opened this issue Jul 17, 2014 · 70 comments

Comments

@zagros
Copy link

zagros commented Jul 17, 2014

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
Copy link

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
Copy link
Author

zagros commented Jul 17, 2014

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

@am11
Copy link
Contributor

am11 commented Jul 17, 2014

This is the same issue that is under discussion at the end of this thread #381. And this is the same issue as #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:

  • Its happening on non-personal machine (the one under domain). I don't have explanation for that, but few ideas how to fix.
  • Its happening due to the import path that the node.js script is calculating from the source file under question. For that matter, we would have to seed it more paths to look for the imported files (for both LESS and SASS).

I tried with these steps: #381 (comment) 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
Copy link

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
Copy link
Contributor

blowsie commented Jul 21, 2014

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
Copy link
Contributor

am11 commented Jul 21, 2014

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
Copy link
Contributor

blowsie commented Jul 21, 2014

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

@am11
Copy link
Contributor

am11 commented Jul 21, 2014

I am counting on your feedback :)

Thank you!

@blowsie
Copy link
Contributor

blowsie commented Jul 21, 2014

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
Copy link
Contributor

am11 commented Jul 21, 2014

@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
Copy link
Contributor

blowsie commented Jul 21, 2014

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
Copy link
Contributor

am11 commented Jul 21, 2014

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
Copy link
Contributor

blowsie commented Jul 21, 2014

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

Its compiling again now, thanks.

@am11
Copy link
Contributor

am11 commented Jul 21, 2014

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

@blowsie
Copy link
Contributor

blowsie commented Jul 21, 2014

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

@Nicholas-Westby
Copy link

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

@samjulien
Copy link

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

@thedigitaldesign
Copy link

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

@Nicholas-Westby
Copy link

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
Copy link

OzBob commented Sep 22, 2014

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
Copy link
Contributor

am11 commented Sep 22, 2014

@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
Copy link

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
Copy link

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
Copy link

@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
Copy link
Contributor

am11 commented Sep 22, 2014

@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
Copy link

@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
Copy link
Contributor

am11 commented Sep 22, 2014

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

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

@Nicholas-Westby
Copy link

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.

@niklasHagner
Copy link

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
Copy link
Contributor

blowsie commented Oct 29, 2014

@niklasHagner WE uses node behind the scenes

@soatley
Copy link

soatley commented Nov 4, 2014

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
Copy link

@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
Copy link
Contributor

am11 commented Nov 4, 2014

@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: 87bd5c3).

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
Copy link

soatley commented Nov 4, 2014

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
Copy link
Contributor

am11 commented Nov 4, 2014

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

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

@soatley
Copy link

soatley commented Nov 4, 2014

@am11 Just checked my version number and I'm running 2.4 but otherwise, I'm not sure what code is responsible. Truthfully, clicking on your link was the first time I've even seen the source code of WE.

@soatley
Copy link

soatley commented Nov 4, 2014

Not sure how helpful this is, but when Node crashes due to a syntax error, it throws this error:

C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\fdsafasdf\Resources\nodejs\tools\server\services\srv-scss.js:96
                Details: regex.message,
                              ^
TypeError: Cannot read property 'message' of null
    at sass.render.error (C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\fdsafasdf\Resources\nodejs\tools\server\services\srv-scss.js:96:31)
    at onError (C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\fdsafasdf\Resources\nodejs\tools\node_modules\node-sass\sass.js:95:16)

@am11
Copy link
Contributor

am11 commented Nov 4, 2014

This is helpful. But is it the only time when it stops responding to you?

Please share the SASS code which is causing this issue.

@soatley
Copy link

soatley commented Nov 4, 2014

Still debugging to see when/what causes it to stop. I'm using a batch file to keep Node running in the background and have enabled logging to a file for STDOUT and STDERR, node.log and node-error.log respectively:
node tools\server\we-nodejs-server --port 54743 >> node.log 2>>node-error.log

For the SASS code, the situation I just realized was a simple syntax error. After position note the semi-colon, instead of a colon:

@media screen and (min-width:1200px) {
    #wb-sm {
        top: -2em;
        position; relative;
    }
}

Upon saving the file, it will crash the node server and throw the error I previously posted.

@SLaks
Copy link
Collaborator

SLaks commented Nov 4, 2014

It looks like the error from node-sass doesn't match our regex.

@Icestorm0141
Copy link

@am11 I am running WE 2.3 with VS 2013 Update 3.

For what its worth, I just had my coworker try the same process with the same version of VS & WE and the he got the same result. Nada css files from trying to click recompile all LESS files. If theres a way I can find an error log I'd be happy to go grab it but I am not sure where one would exist. Compiling the LESS just silently dies most times. It took some odd combination of restarts to find the error that brought me to this thread.

@davidtme
Copy link
Contributor

davidtme commented Nov 4, 2014

@soatley I found the xRegex in srv-scss.js problematic and often result in a null exception that would bring down nodejs. The code srv-scss.js remains the same as the new ruby sass lives in srv-rubyscss.js - The "position; relative;" line doesn't crash 87bd5c3 (Use ruby runtime = true) and results in:
capture

@soatley
Copy link

soatley commented Nov 4, 2014

Not sure about the ruby runtime = true part, sorry, and I don't know anything about node. This is my first project with bundled CSS/JS and SCSS.

I'm using VS 2013 Premium Update 4 on a 64-bit machine and when I put a semi colon after the word position and press CTRL+S to save, it crashes Node. Perhaps it something else on my machine or my particular install.

@SLaks
Copy link
Collaborator

SLaks commented Nov 4, 2014

No; this is a bug in our regex to parse errors from node-sass.
We should read the errors that make it crash and fix the regex.

First, however, we should also change the code to gracefully bail out if the regex doesn't match.

@am11
Copy link
Contributor

am11 commented Nov 4, 2014

@SLaks, yes! Our regex is faulty. There is no error: in that string. I think at some point, they changed the error format.

@mgreter,

I was wrong here: sass/node-sass#464, to assume that libsass returns XML error. I was probably feeling dizzy at the time of reporting that issue and everyone seems to believe that libsass reports errors as XML. 😄

Here we are the downstream to node-sass, and we need to parse the error string using regex (bad idea?).

So, for this code:

@media screen and (min-width:1200px) {
    #wb-sm {
        top: -2em;
        position; relative;
    }
}

Node-sass (and ultimately libsass) returns:

c:/temp/too.scss:4: property "position" must be followed by a ':'

Note there is only line number and no column info.

Since that is open ended issue:

  • should I do a PR for libsass first and parse errors as JSON? This was node-sass can take advantage of it and parse it as JavaScript object (JSON.stringify( .. )). I hope perl-sass and libsass-net would also appreciate errors serialized as JSON.
  • do we have column info in that context, so we can end up with this error format:
{
    "message": "property \"position\" must be followed by a ':'"
    "column": 17,
    "line": 4,
    "file": "c:\\users\\too.scss" // full path to file, comes handy in case of @import
}
  • can we throw other exceptions; seg fault et al. in JSON too (without column and line)?

@skwasiborski
Copy link

Hi,

Had the same error message and it turned out that the problem was that i had non-ascii characters in project path (unfortunatly windows made my user folder contain non-ascii characters). When I moved the solution to C:\SolutionName everything started working.

hope it helps some folks.

@am11
Copy link
Contributor

am11 commented Nov 9, 2014

@mgreter added the desired feature in libsass. Coming release, libsass would return errors serialized as JSON (/cc @kevva, @andrew), which node-sass would just parse as JS object and we would not be needing regex there anymore. See sass/libsass#631 (comment). Thanks @mgreter!

/cc @darrenkopp for libsass-net headsup. @mgreter is also updating WiKi documentation for variety of source-map options and inline comments on the usage of new interface. We will add hooks for those new source-map options in node-sass.


As described in other comment(#1400 (comment)), there is advent of this new issue with npm while flattening node-sass module via npm dedup due to node-sass large dependency chain, multiplied by Windows inability to handle more than 260 chars in path, we need to either move on to @darrenkopp's libsass-net or fix the dedup issue, for example using fenestrate npm -- before the next release of WE.

@zetlen, Can you provide some pointers here? I tried flattening the node-sass' submodules chain with fenestrate as follow:

# powershell
mkdir /temp1; cd /temp1

npm install fenestrate node-sass
# as all the npms are packed inside WE installer, we don't use `-g` switch
# and fenestrate would be used as a build helper, which would not be included in the final package

cd node_modules/node-sass

node ../fenestrate make . 
# successfully updated package.json,
# enumerating all the deep nested modules in it

node ../fenestrate  rewrite .
# throws unknown error:

# Writing flattened package.json...
# Successfully saved flattened package.json. Rewriting node_modules directory...

# events.js:72
#         throw er; // Unhandled 'error' event
#               ^
# Error: spawn ENOENT
#     at errnoException (child_process.js:1001:11)
#     at Process.ChildProcess._handle.onexit (child_process.js:792:34)

@craigbarnes
Copy link

Coming release, libsass would return errors serialized as JSON

Hmm, so now other bindings will need to parse JSON to get the error messages?

@am11
Copy link
Contributor

am11 commented Nov 9, 2014

For instance perl-sass and libsass-net? I think JSON is first-class citizen in most of the programming languages (except for C++, for which libsass is already equipped).

Well, it's better than the plain text.

@mgreter
Copy link

mgreter commented Nov 9, 2014

@craigbarnes You still get the same stuff as before, so no need to use the new json format for errors in any way! It's just there so you can use it if you want! No harm done!

@craigbarnes
Copy link

@mgreter Oh, no worries then. I hastily assumed JSON would replace the old format. My bad.

@avipinto
Copy link

On VS 2013 Update 4 every save on scss file triggers the scss compilation even after turning it off.
I'm using another extension to compile my scss files and i still want to use other features of Web Essentials.
this compilation fails and fills my output window with noise(one of the errors appears at the subject of this thread)
My WebEssentials-Settings.json settings:
"Scss": {
"CompileOnBuild": false,
"CompileOnSave": false,
"EnableChainCompilation": false,
"GenerateSourceMaps": false,
"MinifyInPlace": false,
"NumberPrecision": 5,
"OutputDirectory": "",
"OutputStyle": "Expanded",
"ProcessSourceMapsForEditorEnhancements": false,
"ShowPreviewPane": true,
"UseRubyRuntime": false
},

@KirschnerMatt
Copy link

This is still an issue for me.

I get compilation errors whenever I attempt to save a .scss file with syntax errors. Even after fixing the syntax, I still get the compilation errors and am forced to restart VS.

@Mshael9
Copy link

Mshael9 commented May 19, 2022

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!

@Mshael9
Copy link

Mshael9 commented May 19, 2022

Not sure how helpful this is, but when Node crashes due to a syntax error, it throws this error:

C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\fdsafasdf\Resources\nodejs\tools\server\services\srv-scss.js:96
                Details: regex.message,
                              ^
TypeError: Cannot read property 'message' of null
    at sass.render.error (C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\fdsafasdf\Resources\nodejs\tools\server\services\srv-scss.js:96:31)
    at onError (C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\fdsafasdf\Resources\nodejs\tools\node_modules\node-sass\sass.js:95:16)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests