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

SASS compilation fails on project build #1788

Open
msawczyn opened this issue Feb 27, 2015 · 1 comment
Open

SASS compilation fails on project build #1788

msawczyn opened this issue Feb 27, 2015 · 1 comment

Comments

@msawczyn
Copy link

Any *.scss file in my solutions fail compile when I build or when I give the command to build all SASS files. Oddly enough, though, they succeed when I make a change and save the file (note that the option to build on save is enabled). This is not only my .scss files, but popular ones, like toastr.

I've verified that there are no syntax errors in the files.

I've tried uninstalling/reinstalling WE, but no change. I can give any additional information if needed ... please help.

Below is the output.

========== Rebuild All: 5 succeeded or up-to-date, 0 failed, 0 skipped, Completed at 2/27/2015 2:35:23 PM ==========

2/27/2015 2:35:28 PM: SCSS: toastr.scss compiled.

2/27/2015 2:35:28 PM: Something went wrong reaching: http://127.0.0.1:47527/? <+384 characters> for site.scss

2/27/2015 2:35:28 PM: Something went wrong reaching: http://127.0.0.1:47527/? <+506 characters> for toastr.scss

2/27/2015 2:35:28 PM: Something went wrong reaching: http://127.0.0.1:47527/? <+500 characters> for site.scss in the obj/release/package/packagetmp/content directory

2/27/2015 2:35:30 PM: SCSS: Site.scss compiled.

2/27/2015 2:35:30 PM: Something went wrong reaching: http://127.0.0.1:11415/? <+500 characters> for site.scss in the obj/release/package/packagetmp/content directory

2/27/2015 2:35:30 PM: SCSS: Site.scss compilation failed: The service failed to respond to this request
Possible cause: Syntax Error!
2/27/2015 2:35:30 PM: SCSS: toastr.scss compiled.

manually edited and saved site.scss

2/27/2015 2:56:32 PM: SCSS: Compiling Site.scss
2/27/2015 2:56:32 PM: SCSS: Site.scss compiled.

@randyshoopman
Copy link

I had a similar message appearing in my console (The service failed to respond to this request). I would notice that when I tried to compile my scss files in VS I would see node run very briefly in Task Manager then close. We have many scss files and lots of @import statements.

After running node manually I found that the error handler in [...\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\erhf4eb2.mop\Resources\nodejs\tools\server\services] srv-scss.js was failing, which would crash node.exe. The RegEx is not correctly parsing the error string. It seems to expect "error: " to be in the error string. My error was "...global/_kendo.scss:245: invalid property name" which broke the regex. Seems like the error handler needs to be a little more defensive, maybe a try/catch.


To Run node manually:
>...\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\erhf4eb2.mop\Resources\nodejs\tools\server\node tools\server\we-nodejs-server --port 1234

Then open your browser to http://127.0.0.1:1234/[ rest of path from VS console error ]

Your node process will then report back the REAL error.

In any case, I changed my srv-scss.js error handler to below. Probably not the most elegant fix but gets the job done and keeps node from crashing.

error: function(error) {
var regex = xRegex.exec(error, xRegex("(?<fileName>.+):(?<line>.\d+): error: (?<fullMessage>(?.))", 'gi'));
var regex2 = xRegex.exec(error, xRegex("(?<fileName>.+):(?<line>.\d+): (?<fullMessage>.
)", 'gi'));

        var msg = (regex) ? regex.message : regex2.fullMessage;
        var line = (regex) ? regex.line : regex2.line;
        var fileName = (regex) ? regex.fileName : regex2.fileName;
        var fullMessage = (regex) ? regex.fullMessage : regex2.fullMessage;
        writer.write(JSON.stringify({
            Success: false,                
            SourceFileName: params.sourceFileName,
            TargetFileName: params.targetFileName,
            MapFileName: params.mapFileName,
            Remarks: "SASS: An error has occured while processing your request.",
            Details: msg,
            Errors: [{
                Line: line,
                Message: "SASS: " + msg,
                FileName: fileName,
                FullMessage: "SASS" + fullMessage
            }]
        }));
        writer.end();
    }

Hope this helps someone. I was pulling my hair out trying to fix this.

It appears this regex issue has been known for sometime (#1323). Guess a fix still has not been released. Maybe in the nightly build.

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

2 participants