-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix import failure when using the syncImport option #2953
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
Conversation
Also, if it's helpful, I don't think this bug existed in v2.0.0. |
cfc0927
to
c3b1c48
Compare
@matthew-dean @lukeapage After looking into this a bit more, I think the problem is the way the Should context be taken into account when deduping imports? |
If you want Less to import into both contexts, you can use |
It's the expected behavior that the files compile with Note that the first import occurs only inside the body of the mixin, whereas the second one occurs in the top-level context. I would expect this to cause the variable to be defined in the top-level context. This is what happens with |
@maxbrunsfeld Oh, no you're right. That shouldn't happen. I mis-read your comment. It should not compile in either scenario. |
@matthew-dean Ok, thanks for clarifying. So in general, |
@maxbrunsfeld That's the current behavior, yes, AFAIK. However.... I wonder if subsequent imports should not be treated as something like |
I'm hitting a strange bug when using the
syncImport
option toless.render
.I wasn't sure how to contribute an automated test for this bug, so I have come up with a fairly minimal way to reproduce it. It involves three less files in a directory:
mixins.less:
variables.less:
test.less
The following test script demonstrates the problem. It can be run from the same directory as the 3 less files above.
Expected output:
Actual output:
Let me know if I can provide anything else to help get this fixed. Thanks!