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.

Plugin order not respected

See original GitHub issue

Hi guys,

I don’t know if I am doing something wrong but I’m experiencing some problem figuring out why plugins seems to run not in the order I specified in postcss.config.js.

I created a new vue 3 project and installed tailwindcss, postcss and some plugins to show what I am talking about, I will try to explain some steps I’m doing to figure out. I published it on github here

Starting with main.css image

  • Importing tailwind (with @import because if I put @tailwind directives before import postcss complains it)
  • Importing colors.css file with some css vars and nothing else image
  • Importing components/badge/index.css which imports a mixin, applies some tailwind rules and uses @mixin inside a @each image image

The package.json image

The vite.config.js image

The postcss.config.js image

Now, if i run npm run dev with current postcss config image Seems like mixin plugin is not working, ok.

I tried removing plugins until I found the config which works: image Removing those 2 plugins seemed to be working, output css is what I was expecting image

Now Trying to add only postcss-simple-vars: image Same error as above I think, I don’t know if is the @each or the @mixin plugin

Trying to add only tailwindcss: image Different error but still @each or @mixin plugin not working well I think

I need all of those plugins and I’m sure if each on of those would be executed one at a time it’ll be ok, but in the same process they do this mess. I’m not sure how plugins are executed but I read that the order matters, so there are any chances that some plugin takes priority or it’s been executed asynchronously?

Sorry for the long post, again, here is the repo to reproduce https://github.com/giusepetroso/postcss-plugin-issue

I’m not sure if I should have posted this issue here, or on a specific plugin but actually I can’t figure out what is going on so feel free to send me to an other appropriate repo.

Thanks a lot, Giuse.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Dec 18, 2022

There is no such thing as plugins order. They all applying to CSS in the same moment with an event system.

To fix your bug, we need to do a lot of work in plugins communication. You need to report an issue to Tailwind (seems like the issue is in their event system).

0reactions
giusepetrosocommented, Dec 18, 2022

But the fact is I need to keep Tailwind into the postCSS plugins, it is actually the point, if I remove it there is no issue.

I’m not getting your request, now the project is just the essential css, but Tailwind is part of the problem I cannot exclude it.

Let me understand what do you mean please.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page order not respected on public site with parent/child ...
I used Simple Page Ordering to change the menu order so the child pages are not in alphabetical order under the parent pages....
Read more >
Array of strings in plugin configuration: order not respected
Dear Kong-ers I'm currently developing a plugin where a configuration parameters (let's call it param) is an array of strings.
Read more >
Webpack: Does the order of plugins matter? - Stack Overflow
Yes, the order matters: plugins are bound to the compiler and applied in the order specified. You can look into webpack/tapable for a ......
Read more >
Eclipse plugin does not respect the classpath order in all cases
Hi! I'm building a multiproject where multiple versions of libraries have to coexist. The command line gradle build works flawlessly, ...
Read more >
WooCommerce Wholesale Order Form Changelog
This is the changelog for the WooCommerce Wholesale Order Form plugin. ... Bug Fix: V2: The "In Stock" column does not respect WooCommerce's...
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