Skip to content

Rename/adjust "Rulesets cannot be evaluated on a property" error message #4558

Open

Description

@uncenter

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.

Activity

  1. ThiagoMirandaLiotto commented on Oct 23, 2026

    @ThiagoMirandaLiotto

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions