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

Empty output file #161

Closed
sirMackk opened this Issue Jan 4, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@sirMackk

sirMackk commented Jan 4, 2015

Hi!

I was having issues with gulp-sass outputting an empty file. I spent some time on resolving it, but figured out it wasn't a configuration issue on my end (or not entirely, not 100% sure on this).

I poked around and found that handleOutput was receiving an associative array as its output parameter, which looked like this:

{ css: '.main {\n  background-color: #fff;\n  color: #f30312; }\n\n.wat {\n  color: #00f; }\n',
  map: {},
  stats:
   { entry: 'data',
     start: 1420340205915,
     includedFiles: [],
     end: 1420340205919,
    duration: 4 } }

Then it used this array to create a new Buffer. I think the issue is that passing an array to Buffer might initialize an empty buffer since Buffer might expect a String (not a js person). I fixed this in my local project by suffixing .css to output so that the whole relevant line looks like file.contents = new Buffer(output.css); which works for me.

I'm using the simplest config possible, not passing any arguments, piping it straight to gulp.dest and my scss compiles using both the sass gem as well as node-sass. Not doing source maps so I feel this might be related to #81 .

If you think this is a real issue and not something weirdly specific to my setup, let me, I think I can punch out a PR.

Thanks!

@dlmanning

This comment has been minimized.

Show comment
Hide comment
@dlmanning

dlmanning Jan 4, 2015

Owner

@sirMackk : I'm not able to reproduce this behavior. Could you link to a gist of your gulpfile and tell me which version of node-sass you're using?

Owner

dlmanning commented Jan 4, 2015

@sirMackk : I'm not able to reproduce this behavior. Could you link to a gist of your gulpfile and tell me which version of node-sass you're using?

@sirMackk

This comment has been minimized.

Show comment
Hide comment
@sirMackk

sirMackk Jan 4, 2015

Hi! I'm using node-sass ver 2.0.0-beta and here's the gulpfile itself: https://gist.github.com/sirMackk/1e9e3cb21c980c0a5a03

sirMackk commented Jan 4, 2015

Hi! I'm using node-sass ver 2.0.0-beta and here's the gulpfile itself: https://gist.github.com/sirMackk/1e9e3cb21c980c0a5a03

@dlmanning

This comment has been minimized.

Show comment
Hide comment
@dlmanning

dlmanning Jan 4, 2015

Owner

@sirMackk Ah, that's likely the problem. There are a number of breaking changes in node-sass 2.0 that gulp-sass doesn't support yet. Will likely be getting a corresponding beta of gulp-sass out in the coming week. Closing this issue for now...

Owner

dlmanning commented Jan 4, 2015

@sirMackk Ah, that's likely the problem. There are a number of breaking changes in node-sass 2.0 that gulp-sass doesn't support yet. Will likely be getting a corresponding beta of gulp-sass out in the coming week. Closing this issue for now...

@dlmanning dlmanning closed this Jan 4, 2015

@sirMackk

This comment has been minimized.

Show comment
Hide comment
@sirMackk

sirMackk Jan 4, 2015

@dlmanning Awesome, thanks!

sirMackk commented Jan 4, 2015

@dlmanning Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment