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

Error when compiling .scss file #162

Closed
denismarian opened this issue Jan 29, 2014 · 33 comments
Closed

Error when compiling .scss file #162

denismarian opened this issue Jan 29, 2014 · 33 comments

Comments

@denismarian
Copy link

I have an error when compiling .scss file, appears notification that is error and path to my .scss file. With .less files is ok. I downloaded Koala about one week ago and it always shows me this error.

Windows 7 64, have ruby installed.

@stockman
Copy link

stockman commented Feb 3, 2014

Can you please be more specific? what is the error msg?

@denismarian
Copy link
Author

I'm sorry for my english, it's not my natal language.

It shows me just 'Error' and path to .scss file. Thank you.
ddd

@spacelab-sp
Copy link

Same here, the css is compiled, but this error appear.
A option to disable these popups would be good.

@FlxAlbroscheit
Copy link

BUMP! Same problem here... very annonying! How can I receive any debbug-info? It's like: In the beginning of each Koala-session, the files are rendered perfectly, then after two or three tries it works again, then after 5,6, and so on...

@ignaciolezama
Copy link

Same problem! Did anybody find a solution?
I can compile .less files perfectly, and scss/sass with cmd.

@oklai
Copy link
Owner

oklai commented Apr 11, 2014

Anybody can help to debug this problem?
Debug method:

  1. Find %koala%/package.json, set window.debug and window.toolbar to true;
  2. Find %koala%/app/scripts/compilers/SassCompiler.js:SassCompiler.prototype.sassCompile, add this code global.debug(error) at the bottom of the function.
exec(command, {timeout: 5000, maxBuffer: 2000*1024}, function (error, stdout, stderr) {
    if (error !== null) {
        global.debug(error); // for debug
        emitter.emit('fail');
        self.throwError(stderr, filePath);
    } else {
        emitter.emit('done');
        //add watch import file
        var imports = common.getStyleImports('sass', filePath);
        self.watchImports(imports, filePath);
    }

    // do awayls
    emitter.emit('always');
});

Restart Koala, then press F12 to open the developer tools, switch to the "console" section, if error when compile sass file, the detailed error message will be printed out.

@ignaciolezama
Copy link

I'll try to help, but I have no idea if I'm doing this the right way.
I'm getting this error in the Console section:

Error {code: "ENOENT", errno: "ENOENT", syscall: "spawn"}

@oklai
Copy link
Owner

oklai commented Apr 11, 2014

Thanks. But this information is not enough, please continue test.
Find "argv.push('--cache-location "' + path.join(FileManager.userCacheDir, '.sass-cache') + '"')", and comment this line, add the no-cache option.

//argv.push('--cache-location "' + path.join(FileManager.userCacheDir, '.sass-cache') + '"');
argv.pus('--no-cache');

and print stdout and error.

global.debug(error); // for debug
global.debug(stdout);
global.debug(error);

@ignaciolezama
Copy link

Getting the same error, let me know if there's anything else I could try.

@oklai
Copy link
Owner

oklai commented Apr 11, 2014

There is no other way.
What is the system and the ruby version you are using?

@ignaciolezama
Copy link

Windows 7 64 bits, Ruby 1.9.3
Now I'm getting a longer error:

Error
code: "ENOENT"
errno: "ENOENT"
get stack: function () { [native code] }
arguments: null
caller: null
length: 0
name: ""
prototype: Object
__proto__: function Empty() {}
<function scope>
message: "spawn ENOENT"
set stack: function () { [native code] }
arguments: null
caller: null
length: 1
name: ""
prototype: Object
__proto__: function Empty() {}
<function scope>
syscall: "spawn"
__proto__: d
constructor: function Error() { [native code] }
message: ""
name: "Error"
toString: function toString() { [native code] }
__proto__: Object

@oklai
Copy link
Owner

oklai commented Apr 12, 2014

Try update ruby to the 2.x version, and set Koala, Settings --> Use Custom Ruby --> checked.

@ghost
Copy link

ghost commented Oct 20, 2014

I was facing the same issue.
After investigation, I found that the problem was caused by the "timeout" value.
I set the value to 10000 and it worked (file "%koala%\app\scripts\compilers\SassCompiler.js" line 149)

@AmyLGalles
Copy link

I'm having the same problem. I followed the instructions above and still get a blank error message

@AmyLGalles
Copy link

koalaerror
fix2
fix1

@TillMatthis
Copy link

Hi.
I've run into the same problem and it seems to be caused by a long @import list. We use the ionic framework for phonegap and a lot of separate scss files.

Sebchauss solution to alter the timeout worked great and got rid of the error for me, to.
Thanks!

Like this:

„I set the value to 10000 and it worked (file "%koala%\app\scripts\compilers\SassCompiler.js" line 149)”

@ghost
Copy link

ghost commented Nov 24, 2014

It maybe would be a great idea to have an explicit error message and a configurable setting directly in the application ?

@TillMatthis
Copy link

Yes. I second that. Sebchauss is right. Either a fix for that bug, or give us a setting ... something like a "troubleshooting" tab in the advanced settings where we can set the timeout for troubleshooting issues.
With an explanation that a higher timeout can help with errors from extremely long import lists.

@buzznick
Copy link

buzznick commented Jan 5, 2015

I was having the same issue and sebchauss solution worked for me. Cheers.

"I set the value to 10000 and it worked (file "%koala%\app\scripts\compilers\SassCompiler.js" line 149)"

@Mervel
Copy link

Mervel commented Jan 30, 2015

I have the same problem and
"I set the value to 10000 and it worked (file "%koala%\app\scripts\compilers\SassCompiler.js" line 149)"
doesn't work for me. Do you have any other ideas?

@FreezyExp
Copy link

50000 worked for me on an cheap laptop, it just takes too long (causing the access errors I guess)

@mort3za
Copy link

mort3za commented Mar 7, 2015

Updating ruby to 2.2.1 and setting timeout to 10000 (based on @TillMatthis comment) solved my issue.

platform: win 8.1 x64

@eric-harms
Copy link

Thanks to everyone who discovered a fix. I was pulling my hair out. 10000 worked for me.

@oklai
Copy link
Owner

oklai commented Mar 24, 2015

Thanks all, I will set the default value of maxBuffer to 10000*1024.

@Judder
Copy link

Judder commented Jul 21, 2015

Setting timeout to more than 5 seconds as per above fixed this nicely

You can test if this is the problem by removing a number of your include files, to make the compilation less than 5 seconds, and then it will compile Error free again

@soumen-sarkar
Copy link

I have the same problem. It can compile .less files can't sass
"I set the value to 10000 and it worked (file "%koala%\app\scripts\compilers\SassCompiler.js" line 149)"
doesn't work for me. Do you have any other ideas?
screenshot 2015-10-12 15 47 18

@ucavus
Copy link

ucavus commented Oct 27, 2015

To @soumen-sarkar and others still getting this error, go higher. I tried 30000 and still had errors. Setting 60000 (one minute) solved it for me.

@alenb
Copy link

alenb commented Dec 26, 2015

I had the same blank error message with just the path. My solution was to untick Source Map and it worked for me. Not sure if this will help, but I thought I'd leave it here anyways.

@Cf-251
Copy link

Cf-251 commented Jan 17, 2016

changing to 15000 worked)

@ghost ghost mentioned this issue Jan 28, 2016
@donomron
Copy link

donomron commented Apr 9, 2016

@sebchauss trick worked for me too! Thanks

@bertanyaman
Copy link

@TillMatthis 10000 is also worked for me !

@peterromero
Copy link

I changed timeout to 500000 and maxBuffer to 100000*1024, and am still getting the error. I also unticked Source Map. I added the lines to the SassCompiler.js and also to package.json but I don't get anything in the console... just a blank error. What else can I try?

zaygraveyard added a commit to zaygraveyard/koala that referenced this issue Apr 25, 2017
* develop:
  Bump version to 2.1.0
  Update copyright year to 2017.
  Correct a contributor’s name.
  Update the compilers.
  Add a build system for making releases using gulp.
  Add a workaround a bug in nwjs/nw.js#5513
  Update the URL to be relative.
  Replace `require(‘nw.gui’)` with the global `nw`.
  Remove setting the `localStorage` of the `global`. It’s set by default.
  Improve the feature
  Use JSON files and update default JSON config files
  Support for AutoPrefix Config on CSS, LESS and Sass
  change the default value of maxBuffer oklai#162
@apanasenkamaksim
Copy link

This error occurred after reinstalling from disk C to disk D in my case. I returned it to drive C, and it works for me

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