Skip to content
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

Undefined mixin on first run #46

Closed
stephenway opened this issue Feb 8, 2016 · 8 comments
Closed

Undefined mixin on first run #46

stephenway opened this issue Feb 8, 2016 · 8 comments

Comments

@stephenway
Copy link

With mixins I'm importing from node_modules

@import 'stylep-dropdown';

.c-dropcard--right {
  @mixin dropdown-callout-inline;
  @mixin dropdown-inline .5em 1em, 0, 289px;
  @mixin dropdown-solid var(--callout-bg-color), var(--grey-100), rgba(0, 0, 0, .75), 4px, var(--grey-600) 0 0 7px;
  @mixin dropdown-callout-solid var(--callout-bg-color), 0 0 3px 1px rgba(0, 0, 0, .4);
  @mixin dropdown-callout-left-top;
}

I'm getting an error:

[09:40:35] Starting 'css'...

events.js:154
      throw er; // Unhandled 'error' event
      ^
Error: postcss-mixins: /Users/Stephen/project/src/patterns/dropcard.css:17:3: Undefined mixin dropdown-callout-inline
.c-dropcard--right {
  @mixin dropdown-callout-inline;
  ^
  @mixin dropdown-inline .5em 1em, 0, 289px;

And with the same code on second run

[09:45:08] Starting 'css'...
[09:45:11] Finished 'css' after 2.88 s

It's seeming like there is a open loop where it can't read or refresh what's in node_modules on first run.

@ai
Copy link
Member

ai commented Feb 8, 2016

Where did you define mixins?

And what is your plugin list?

@ai
Copy link
Member

ai commented Feb 8, 2016

Maybe this issue is related? postcss/postcss-import#168

@stephenway
Copy link
Author

Mixins here, installed via NPM https://github.com/stylep/stylep-dropdown/blob/master/index.css

and my processors are:
screen shot 2016-02-08 at 2 41 17 pm

@ai
Copy link
Member

ai commented Feb 8, 2016

Yeap, looks like you have problem with import.

You can always check it by open mix in plugin JS file and put console.log(css.toString()) inside.

@ben-ben-eb maybe we should add some option for postcss-devtools to see input CSS for some plugin?

@stephenway
Copy link
Author

@ben-eb

@ben-eb
Copy link
Member

ben-eb commented Feb 9, 2016

Sure, PR welcome.

@toomuchdesign
Copy link

In my case, switching back to postcss-import v.7 fixed the problem. Related issue.

@stephenway
Copy link
Author

Yea, or in my case, switched to postcss-apply.

@ai ai closed this as completed Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants