sindresorhus / grunt-sass

Compile Sass to CSS
MIT License
1.01k stars 209 forks source link

Fatal error: Arguments to path.resolve must be strings #225

Closed mfirry closed 9 years ago

mfirry commented 9 years ago

Hi, I'm moving an old(-ish) project that was using grunt-contrib-compass to grunt-sass. I've updated everything to the latest versions. So now using "grunt-sass": "^1.0.0". I'm using load-grunt-config so I've basically just created this new sass.coffee like this:

module.exports =
  dist:
    files:
      '<%= tmp %>/main.css': '<%= sass %>/main.sass'

But I constantly get Fatal error: Arguments to path.resolve must be strings.

What's weirder is that I tried a brand new (fake) project with the very same structure and everything just works flawlessly there. What can I be missing?

My env details: grunt-cli v0.1.13 grunt v0.4.5 node v0.12.6 OS X 10.10.4

sindresorhus commented 9 years ago

Run grunt --stack to see where the error is coming from. Paste it in here.

mfirry commented 9 years ago

Here it comes: http://pastie.org/10281354

sindresorhus commented 9 years ago

The stack trace you pasted is showing a different error.

mfirry commented 9 years ago

Sorry: here's the right one -> http://pastie.org/10283790 It seems like it's not reading my configuration using defaults.

sindresorhus commented 9 years ago

Looks like you're trying to pass in a directory and node-sass is not able to read that as a file.

{ [Error: File to read not found or unreadable: /Users/mfirry/projects/reputation/hermes-js/src/sass]
  message: 'File to read not found or unreadable: /Users/mfirry/projects/reputation/hermes-js/src/sass',
mfirry commented 9 years ago

I'm using the same paths I use with the grunt-contrib-compass process. Here's my dir structure: http://pastie.org/private/dyswmuyx8cn2pg9vxpug

Also, if I change the sass.coffee file with some random directory, say

module.exports =
  dist:
    files:
      'randomCssDir/main.css': 'randomSassDir/main.sass'

I still get the very same error. That is why I was saying that it just does not seem to read the configuration I'm setting.

sindresorhus commented 9 years ago

Happy to receive a failing test, but I'm pretty sure you're doing something wrong with your config.

mfirry commented 9 years ago

Ok. Found the issue. I had a sass key on my Grunt config which somehow conflicted with the sass task I was declaring on sass.coffee. Thank you so much!