sindresorhus / grunt-sass

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

"Original" argument must be of type Function. Received type undefined #288

Closed jasonsturges closed 6 years ago

jasonsturges commented 6 years ago

In upgrading a project from v2.1.0 to v3.0.1, I'm now receiving an error:

Fatal error: The "original" argument must be of type Function. Received type undefined

Not sure what this is referencing; however, is new after the upgrade.

SASS portion of Gruntfile.js:

sass: {
    dist: {
        options: {
            implementation: 'sass-dist',
            outputStyle: 'compact',
            sourceComments: false,
            sourceMap: true
        },
        files: {
            'css/example.css': 'sass/example.scss',
        }
    }
}
Suriv commented 6 years ago

Look at the grungfile of the project, this is the key.

https://github.com/sindresorhus/grunt-sass/blob/master/gruntfile.js

The new version needs Node 8 or higher

tobsn-me commented 6 years ago

I ran into this error, too. To fix this, follow these steps:

  1. Add node-sass to your project

    $ npm i node-sass --save-dev
  2. Include node-sass in your Gruntfile

    const sass = require('node-sass');
  3. In your sass options, change the following line

    from

    implementation: 'sass-dist'

    to

    implementation: sass
JonMcL commented 4 years ago

If anyone ends up here and can't figure it out, this might help ---

I accidentally (stupidly?) had the 'implementation' argument as a string, so change

implementation: 'sass'

to

implemenation: sass

This of course depends on the

const sass = require('node-sass');

line to populate the sass object.