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
Rename/adjust "Rulesets cannot be evaluated on a property" error message #4558
The error added in #4478 for when a mixin call is used as a property value (e.g. mixin called without specifying which variable to pull out as the value) has a confusingly worded "Rulesets cannot be evaluated on a property" error message. I noted this on the day the pull request was merged back in September.
... the error "Rulesets cannot be evaluated on a property" is still a pretty unsatisfyingly vague error message- I don't know what that even means. I would hope for a more explicit error message instead of reusing the existing one in that branch, like "Assigning mixin result to property requires a return value lookup" etc.
Hi! I'm Thiago, a student at the technical school of Instituto Politécnico Modelo (Argentina), and I'd like to work on this issue as part of a school open-source contribution assignment.
In packages/less/lib/less/tree/declaration.js the same check covers two cases: a detached ruleset used as a property value (a: @a;) and a mixin call used as a property value (color: #rgbify(#fff);), so both get the same message.
My proposal is to split it: keep the current message for detached rulesets, and for mixin calls throw a more explicit one, something like "A mixin call cannot be used as a property value without a lookup, e.g. #rgbify(#fff)[@rgb]", and update the mixin-as-value error test. Does that sound good? I'm happy to change the wording if you prefer something else.
Activity
ThiagoMirandaLiotto commentedon Oct 23, 2026
Hi! I'm Thiago, a student at the technical school of Instituto Politécnico Modelo (Argentina), and I'd like to work on this issue as part of a school open-source contribution assignment.
In
packages/less/lib/less/tree/declaration.jsthe same check covers two cases: a detached ruleset used as a property value (a: @a;) and a mixin call used as a property value (color: #rgbify(#fff);), so both get the same message.My proposal is to split it: keep the current message for detached rulesets, and for mixin calls throw a more explicit one, something like "A mixin call cannot be used as a property value without a lookup, e.g.
#rgbify(#fff)[@rgb]", and update themixin-as-valueerror test. Does that sound good? I'm happy to change the wording if you prefer something else.