Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Functions may not be defined within control directives or other mixins

In my nodeJS project suddenly it give error.I do not any upgrade or changes. When I write NPM start in command line it give that error

 ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?
sourceMap&outputStyle=expanded&includePaths[]=c:/TFS/rc1/app/scss&includePaths[]

=c:/TFS/rc1/~/compass-mixins/lib&sourceMap&sourceMapContents=true!./app/scss/_toolkit.scss
    Module build failed:
    undefined
     ^
          Functions may not be defined within control directives or other mixins.
          in c:\TFS\rc1\node_modules\compass-mixins\lib\compass\functions\_lists.scss (line 81, column 3)
     @ ./app/scss/_toolkit.scss 4:14-337

I reinstall compass-mixins package but it still give same error.Then I looked _lists.scss that file in 81 line there is a code .I deleted that bu it give same error.What should I do?

@if not(function-exists(compact)) {
  @function compact($vars...) {
    $list: ();
    @each $var in $vars {
        @if $var {
            $list: append($list, $var, comma);
        }
    }
    @return $list;
  }
}
like image 615
user1688401 Avatar asked Apr 21 '16 16:04

user1688401


1 Answers

I also face the similar problem. And my project is using gulp-sass and compass-mixins. As heart.cooks.mind points out that, gulp-sass is depending on node-sass. And node-sass upgrade one of its dependence libsass to version libsass 3.3.3 Delorean since node-sass 3.5.1.

However, one of libsass 3.3.3 Delorean changes is related to this problem:
'Disallow functions to be defined in control directives or mixins (@mgreter, #1550)'

Obviously, _lists.scss in compass-mixins break this rule. Seems someone raise an issue to compass-mixins and they have idea on fixing it.

Before compass-mixins release the issue fixed version, my temporary workaround is to delete node_modules/node-sass manually and npm install [email protected]

like image 135
Vincent Pang Avatar answered Oct 06 '22 22:10

Vincent Pang