-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
New version 0.4.2 capture lot of warnings #250
Comments
experiencing the same issue |
What does this warning mean? How do we resolve it? |
We are trying to generate a CSS file but your codebase has multiple possible orderings for these modules. In this case you used So not defining a clear order can lead to fragile builds, that's why we display a warning here. There are two things that you can do: Sort your imports to create a consistent order. I must admit that the warning could be improved to point to the locations that need to be changed. Ignore the warning with |
also got these "conflicting order between " while compiling and a rollback to 0.4.1 solved the problem... |
@wende60 you should solve order problem, not downgrade |
@evilebottnawi unfortunally i do not even understand what i have to order here... the loaders? Maybe you can give me a hint... |
@wende60 looks above and read post #250 (comment) |
@evilebottnawi do i understand it right: i should play around with the order of imports in the file that is - maybe - the location? Ok, will tryout... thanks |
We used the sort-import plugin for VS Code to insure our entire team is importing modules in the same order. Unfortunately, even after insuring the order is the same, we still see these warnings from the mini-css-extract-plugin |
@timothywisdom Sorting imports/modules per file (within) !== Import/Module Order in the Import/Module Tree/Graph (in relation to other files) |
This seems like an unreasonable request (to ensure order within our graph)... we need a way to turn this off for projects that don't care. For example, in my projects each component's styles are self contained so order is only important within each component. (each component has a very unique class name root and all selectors are scoped to them) |
I'm confused - how do I sort "Import/Module Order in the Import/Module Tree/Graph"? |
I think you would have to layout all your imports and make sure to always import things in the same order following the tree traversal order. (Not ideal) |
I believe I have done that via the sort-imports plugin for VS Code. Edit: actually, I'm sorting them alphabetically, not by tree-traversal order. That would be a nightmare to figure out for every file |
It's very inconvenient at best and realistically unmanagable at a certain project size. That's what CSS Module (automatically) or a CSS naming convention (e.g BEM/ITCSS(Namspace + BEM)) (manually) are for. Nevertheless if one uses CSS without particular care on the matter he/she likely runs into issue with the CSS Cascade and there should be a warning at least (optional) @timothywisdom It's always hard to tell why you get these warnings and where within your project. I'm not saying sorting them for every file doesn't eventually help, but it definitely will not solve all issues. See #250 (comment)
|
This was truly a bug I think. I have following structure:
Each
|
@ulivz the warning output you gave doesn't line up with your example structure. |
Tried to add |
@sokra do you know any practical way to do that? As pointed out above, alphabetical order doesn't always work: // a.entry.js
import './a.css'
import './b.css' // b.entry.js
import './b.css'
import './c.js' // c.js
import './a.css' Here, all the imports are sorted alphabetically, but |
Still waitting for this 😇 🙏
Solving this warnings by disable them globaly is wrong. The messages are useful when you have nested use of same components and then the order is important!
So the solution here is "lazy" loading (getting this from Webpack doc (?) not sure now)
|
There is now an NPM package named @webkrafters/ordercss which tackles this issue. Full disclosure: I initially created it to solve this very problem in one of my apps but decided to expand it and share it with everyone. If this package helps anyone, please share it with others. Thanks and good luck! |
same issue here💔 |
@cdll working on this too... will get back here if I find anything. Any luck for you? |
I wrote a detailed explanation of why this happens and what are the solutions at: https://stackoverflow.com/a/67579319 |
So how do we fix this when everything is ordered and the error still occurs, yet we don't just want to disable the warnings? |
by applying webpack-contrib/mini-css-extract-plugin#250 (comment). The warning was introduced in b34754b
This works, except the warning doesn't show |
Lot of conflicting order warning, but this css files not care about their order!
The text was updated successfully, but these errors were encountered: