-
Notifications
You must be signed in to change notification settings - Fork 1.3k
@import fails in node-sass 0.2.4 #27
Comments
+1 for this issue, can't figure out what's causing it. My example var sassOptions = {
include_paths: [options.baseUrl]
};
if (options.minify) {
sassOptions.output_style = 'compressed';
}
sass.render(css, function(err, output){
if (err) fail(err);
compiledCSS = output;
console.log("Done!");
fs.writeFile(outputFile, compiledCSS, done);
}, sassOptions);' @import "ProductSearchView.scss";
|
This is kind of a huge issue. Any thoughts on fixing this? |
I'll look into this as soon as I get the chance. |
voting for this. I just tried to use node-sass and it failed such way. It is critical bug. Without import it is unusable for real projects. |
I'm just looking into this now, I believe it's because node-sass currently uses the string context of libsass. Once I've completed #25 it should be easy to fix. |
I'll look into this as well. Thanks for the bug note! |
👍 Would love to see this get fixed. If I try to use any builds before 0.2.4 I get Segmentation Fault: 11 errors. I simply can't use this yet, so I'm still stuck with the Ruby Sass. |
👍 I would also like to see this get fixed. manually parsing our sass files until it's fixed, hope thats soon! |
I've just published 0.3.0 which I believe fixes this issue, can anyone else confirm? |
Nope, still the same error.
|
@yefremov which OS are you running on? I forgot to rebuild binaries for platforms other than mac. |
@andrew Windows 7 |
I don't have a Windows 7 VM to hand, can you try rebuilding it on your platform? I've added instructions to the readme: https://github.com/andrew/node-sass#rebuilding-binaries |
Uhh, not that easy to do it on Win: if (process.platform === 'darwin') {
spawn('node-gyp', ['rebuild']);
} I'll try to dig into it tomorrow and let you know. |
Ah, not idea. You could try:
|
I'm still getting the error with 0.3.0 on OS 10.7.5 Rendering this code: @import "mixins";
body {
@include fullsize();
color:white;
} Results in the error: (mixins.scss is in the same directory as this file and I also tried it with an explicit file extension with no luck) |
Same here. OS X 10.8, using node-sass v0.3.0. |
Same as @noazark but Archlinux |
I've just pushed a new version, can you give it a try with 0.4.0 |
Still not working for me, but I'm on an older version of node and it looked like node-sass wanted >= 0.10.0 |
Not working for me on Windows 8, using node-sass 0.4.0. |
I found a workaround for my situation, maybe it can be of help for others with the same problem: What I did basically is grab the raw Sass as a string, and let node-sass render that for me. Since it's current working directory is wherever your server.js file is located, you're going to have to put url's in your sass file relative to your server.js. https://github.com/branneman/frontend-bootstrap/blob/master/server.js#L13-24 |
@branneman I've published v0.4.3 which has windows binarys for 32 and 64bit, can you give that a try? |
It seems to me that this error only occurs if the file cannot be read. The error itself is originating from within libsass. @branneman When you use node-sass's render (or now renderSync) functionality directly, then libsass ends up getting fed a string of bytes representing the contents of the file, rather than the filename for libsass to load directly. If the base scss file (and the files it includes) is in any other directory than that which the code is being executed from, then you absolutely must pass this in to Unfortunately I'm not sure how this applies to the middleware version of node-sass, though it generally only comes about from not being able to locate a file. TL;DR: use the |
Perfect! That solves it, you can see in this commit how my code ended up: |
For me, this bug still appears in node-sass 0.6.4 on Windows 7 when combined with mincer and grunt.
Here are some of the relevant files Gruntfile.js // ...
mince: {
'application.css': {
include: ['assets/stylesheets', 'vendor/stylesheets'],
src: 'application.css.scss',
dest: 'tmp/application.css'
}
},
// ... application.css.scss //= require normalize
@import "components/hidden-pin";
@import "layouts/common";
@import "layouts/simple";
@import "layouts/full";
@import "pages/pin-input"; The same project builds just fine on Linux Mint / Ubuntu. |
@dfyx any luck finding a workaround? |
Is this still an issue in 0.7.0? |
I'll check tomorrow when I'm back at work. |
Okay, I'll have to wait for the next release. Compiling the whole thing from source would take a little more time than I have right now. (If you want me to test it earlier, please send me a precompiled version for 32 bit Windows) |
@dfyx the compiled code didn't change, only the javascript file |
I'll try again tomorrow. |
Alright, took a little longer than expected (honestly I just forgot to check). The problem still exists with node-sass 0.8.1 but the error message is slightly different:
|
Okay, update: fixed by installing a newer version of grunt-mincer. |
Are you sure you're using 0.2.4? That's an incredible old and unsupported Please update to 3.1.
|
When attempting to use a simple @import I get the following error message: -
My app config: -
My SASS 'screen.scss' (in the same directory as '_variables.scss': -
I have also tried importing '_variables.scss'
Any thoughts / help welcome.
The text was updated successfully, but these errors were encountered: