-
-
Notifications
You must be signed in to change notification settings - Fork 384
Conflict order of styles #382
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
Comments
Because you have conflict in order, it is expected, you need fix order, extracting css sometimes is non deterministic |
agreed. But the old one |
It is just warning you can ignore this |
For me, the same warnings are coming and the worst part is no css is applied on the project. |
For me
|
any updates? |
@vtereshyn Check the order of the import of your components. Example: You have two components: 📄 Header.js
📄 Footer.js
SCSS files: 📄 header.scss
📄 footer.scss
📄 variables.scss
You have two views/pages/containers: 📄 Page1.js
📄 Page2.js
Reordering Page2's imports should solve your issues
|
Okay, so you are proposing me to check the order of imports in components which use css modules separately. That's interesting and can be confused for me. If you are really want mini-css-extract-plugin users to do that, so please create eslint plugin which will help us to do that, otherwise, mini-css-extract-plugin developers should fix this issue and make it as we had before. |
@vtereshyn As you can see, we have discussed this topic here. And having proper order makes sense. However, the old one |
@evilebottnawi this is not just a warning. In projects where people have same class names, overrides of styles, etc like that (sometimes it happen without our will) it makes styles broken and we can't move to this solution |
@evilebottnawi coming back to this question. I found that
|
Sorry, but the "check your order" suggestion is pretty much impossible in a larger application without a tool doing that and thus kind of useless. |
I got the problem too.
If the warning is expected, it is better to provider more info for user to "check your order" if two base component (such as |
I try to check the output files. The warning:
The chunk
The chunk
The sources order is difference between chunk |
I guess no one in this thread is going to like hearing this, but the only way I found to fix these warnings is really by "checking your imports." What that means is I had to realise what went wrong in the first place. What happened in my case is that I have 4 types of imports – The solution was to enforce strict import rules and follow them in every module. Personally, I had to swap the import order between components and helpers. I agree that this is a cumbersome solution and not easily fixable in large projects, though. On the other hand, my warnings are now gone, yay! |
This seems to be an unfixable problem if you are using a component library and it's imports aren't consistent order. For example, antd |
I found this problem in such case: Parent.js import styles from './parent.module.scss' Child.js import styles from './child.module.scss' Page.js import Parent from 'Parent.js'
import Child from 'Child.js'
export default () => (
<Parent>
<Child>
<SomeComponent />
</Child>
</Parent>
) and then I solved this problem with: Page.js import Child from 'Child.js'
import Parent from 'Parent.js'
export default () => (
<Parent>
<Child>
<SomeComponent />
</Child>
</Parent>
) when |
Add the {enforce:true} option to the "style" cacheGroup, i was having that same issue with vue inlined scss styles, they were being processed and compiled to css and even appearing in the chunk list, but all i was getting were the normal imports until i added the option i mentioned. Hope it helps you. |
i'm ignorning my CI is not. |
This is still an issue, why was it closed? |
It's 2023 and we are still struggling with it. any update? |
@pouyajabbarisani You can find an option to disable warnings |
Have someone find the solution of this problem? |
any updates? |
Unfortunately, I repeat once again, this problem cannot be solved on the plugin side, there are only two options - disable warnings, we have an option for this (look at our options in readme), or correct the order of styles, this warning says that we cannot determine the correct order because in one case one comes first, in the second another and what the obvious order is simply cannot be determined |
What are the actual issues created by this behavior? Despite the warnings, my application doesn't seem to be losing styles. Also, do we still have no eslint plugin to warn about import order? |
You can see other order of styles, webpack tried to resolve it and done it right for you, but it doesn't mean it will be the same for other.
I think no, it is not a simple plugin, I don't see somebody tried to solve it. |
Good day, we moved from 2.6 webpack to 4.28.4. It's a big bump and of course we migrated from old css plugin to new mini-css-extract-plugin. However, it doesn't bundle css properly anymore, which causes wrong render
We have dozens of the next warnings. Seems like something is wrong with optimization of chunks of css
rule is
optimization looks like
plugins is
if I replace
MiniCssExtractPlugin.loader
withstyle-loader
, it seems to be switched off and error no longer appears, except I have nostatic/style.css
file generated and all styles become inlinedThe text was updated successfully, but these errors were encountered: