Closed zagros closed 10 years ago
@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.
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)
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.
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.
It looks like the error
from node-sass doesn't match our regex.
@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.
@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:
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.
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.
@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: https://github.com/sass/node-sass/issues/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. :smile:
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:
JSON.stringify( .. )
). I hope perl-sass and libsass-net would also appreciate errors serialized as JSON.{
"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
}
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.
@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 https://github.com/sass/libsass/issues/631#issuecomment-62291860. 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(https://github.com/madskristensen/WebEssentials2013/issues/1400#issuecomment-62299927), 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)
Coming release, libsass would return errors serialized as JSON
Hmm, so now other bindings will need to parse JSON to get the error messages?
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.
@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!
@mgreter Oh, no worries then. I hastily assumed JSON would replace the old format. My bad.
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 },
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.
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!
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)
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: