You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiple scoped imports via (reference) fail #3813
I don't disagree this is somewhat counter-intuitive, but it's consistent with the way that @import is defined. In other words, @import was defined first with a "single-call" kind of pattern, to avoid duplication. Then multiple was added to signal duplication. Then reference was added. (I could have the order of the last two flipped.)
In the future, this will likely be made more clear with more intuitive behavior with separate at-rules for including qualified rules vs including variables / mixins. See: less/less-meta#39
Still reproduces on current master. In the meantime there is a workaround: add the multiple keyword so the file is brought into each scope instead of being deduplicated:
The underlying cause looks like the same-file import dedup: the second @import "abc" is treated as already-imported and skipped, so its mixins never land in the second scope. The check is in import-manager.js (the importManager.files[...] guard, unless options.multiple). Whether a (reference) import - which only emits the parts that are actually used - should be exempt from that dedup is really the design question here.
Activity
matthew-dean commentedon Oct 2, 2023
I don't disagree this is somewhat counter-intuitive, but it's consistent with the way that
@importis defined. In other words,@importwas defined first with a "single-call" kind of pattern, to avoid duplication. Thenmultiplewas added to signal duplication. Thenreferencewas added. (I could have the order of the last two flipped.)In the future, this will likely be made more clear with more intuitive behavior with separate at-rules for including qualified rules vs including variables / mixins. See: less/less-meta#39
Lfan-ke commentedon Jul 25, 2026
Still reproduces on current
master. In the meantime there is a workaround: add themultiplekeyword so the file is brought into each scope instead of being deduplicated:Both
.two()calls then resolve.The underlying cause looks like the same-file import dedup: the second
@import "abc"is treated as already-imported and skipped, so its mixins never land in the second scope. The check is inimport-manager.js(theimportManager.files[...]guard, unlessoptions.multiple). Whether a(reference)import - which only emits the parts that are actually used - should be exempt from that dedup is really the design question here.