question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mixins may not be defined within control directives or other mixins

See original GitHub issue

Issue type

I’m submitting a … (check one with “x”)

  • bug report
  • feature request

Issue description

Current behavior:

Crashes when compiling, with the message:

ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--8-3!./src/app/@theme/styles/styles.scss
Module build failed: 
  @mixin hover-checked-border($color) {
        ^
      Mixins may not be defined within control directives or other mixins.
      in /Users/.../node_modules/@nebular/theme/styles/global/bootstrap/_custom-forms.scss (line 8, column 10)

Expected behavior:

the app should compile

Steps to reproduce:

Not sure here, it happened after messing with the packages organization. I am posting here because it seems like a valid bug, as sass shouldn’t allow nested mixins (I’m not an expert, I just read this)

Other information:

Angular, Nebular

Angular 5.2.9
Nebular 2.0.0-rc.6

Please delete this issue if the nested mixin code is valid indeed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
jaysturmcommented, Apr 5, 2018

Wondering about the status of this fix? The workaround doesn’t fix everything for me. after building with node-sass@4.8.1 I get the following =>

ERROR in ./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref–8-3!./src/app/@theme/styles/styles.scss Module build failed: undefined ^ Argument $color of lighten($color, $amount) must be a color

Backtrace: node_modules/@nebular/theme/components/checkbox/_checkbox.component.theme.scss:13, in function lighten

2reactions
jaysturmcommented, Apr 5, 2018

@nnixaa no problem, I have removed my other comments. So you would like me to create a new issue on something that you are considering fixed? I was simply wondering when your fixes were planned to be released. I will open a new issue, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mixins may not be defined within control directives or other ...
Now, i found the solution there was an issue with node-sass pacakge. so install the. npm i node-sass@4.8.1. package then it works.
Read more >
SCSS: Functions may not be defined within control directives
Hello,. I got this message after compiling the file mdb.scss: Error: Functions may not be defined within control directives or other mixins.
Read more >
Mixins may not be defined within control directives or other ...
Mixins may not be defined within control directives or other mixins. ... Mixins may not be defined within control directives or other mixins....
Read more >
mixin and @include - Sass
Mixins allow you to define styles that can be re-used throughout your stylesheet. They make it easy to avoid using non-semantic classes like...
Read more >
Node Sass error in Angular: Mixins may not be defined within ...
Coding example for the question Node Sass error in Angular: Mixins may not be defined within control directives or other mixins-angular.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found