-
Notifications
You must be signed in to change notification settings - Fork 115
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
Incorrect nested import ordering #168
Comments
Can you create a PR with a breaking test? |
Done :) #169 |
What is the status on this issue? I am also affected by it. |
The status of an opened issue is: the issue is still open, so not fixed. |
No worries, does anybody has a workaround for this issue? Perhaps disabling de-duping? |
For anyone looking at this issue, temporary fix is to set |
EDIT: maybe there could be an option to disable parallel loading? |
I believe I am also experiencing this issue. I was about to post the following which sounds like postcss/postcss-simple-vars#42 and looks a lot like #169. Doing the following causes intermittent a.css @import 'some-module/variables.css';
// use variables from variables.css b.css @import 'some-module/variables.css';
// use variables from variables.css index.css @import './a.css';
@import './b.css'; As a result we've had to resort to: a.css /*@import 'some-module/variables.css';*/
// use variables from variables.css b.css /*@import 'some-module/variables.css';*/
// use variables from variables.css index.css @import 'some-module/variables.css';
@import './a.css';
@import './b.css'; |
Please use v7 while it's resolved. |
That appears to work. Thanks! |
@MoOx Did a little fooling, couldn't figure it out. Mind elaborating a bit? (Un)related question: What does |
As I said before, I am not the author of this code base, and the author decided to ignore this project for some reasons (that's why I talked about reverting to v7, which is a codebase I know). Anyway I will try to give you some pointers. At the end, resolveImportId() mutate the initial passed statement (called stmt) childrens. The naming of "result" inside the function is a bit confusing since the parent block level also have a "result" variable. I merged a failing test into master, so know you can do the following:
|
@MoOx Progress! 🎉 I think I am getting closer to the issue. |
@MoOx @ai I have found the issue and made a fix, however, I broke the @MoOx If that test is depending on incorrect behavior, please tell me/submit a PR. |
Thought I would leave this for tomorrow; I was so engrossed, I had to fix it tonight! The test was faulty. PR done: #236. 🎉 |
Had to edit a test that depended on the old, incorrect behavior Closes #168
I just discovered this bug, where two imports that both import the same file can end up with the imported file out-of-order intermittently (due to parallel loading).
For example, if two separate files import
base.css
, in some cases the second file will process first and actually include it. Whereas the first file will not (due to de-duping) and then the result will be out-of-order and can affect the resulting applied styles (or variable definitions).I have a full test case in my branch: adam-h@569ea1e
Note how the first import is delayed so that the second will always process first (removing the randomness of occurance due to the filesystem).
The text was updated successfully, but these errors were encountered: