Skip to content

False "Whitespace between a mixin name and parentheses for a mixin call" deprecation warning #4339

Closed

Description

@egonolieux

I'm getting a lot of mixin related errors like these:

<w> DEPRECATED WARNING: Whitespace between a mixin name and parentheses for a mixin call is deprecated in /home/egonolieux/projects/some-project/assets/less/mixins/divider.less on line 50, column 20:
<w> 50     .divider-bottom(
<w> 

It seems like splitting the mixin arguments over multiple lines (for better readability) causes the issue:

.divider-bottom(
  @spacing-top,
  @spacing-bottom,
  @border-width,
  @border-color
);

This is confusing because there is no whitespace between the mixin name and parentheses here. However, when rewriting it like this:

.divider-bottom(@spacing-top,
                @spacing-bottom,
                @border-width,
                @border-color
);

Or like this:

.divider-bottom(@spacing-top, @spacing-bottom, @border-width, @border-color);

The deprecation warning no longer shows up. It seems this has been introduced since #4319.

Activity

  1. dosubot commented on Apr 11, 2025

    @dosubot

    Hello @egonolieux! I'm Dosu, your friendly helper bot here to assist you with bugs, answer questions, and guide you toward becoming a contributor. I'm here while you wait for a human maintainer!

    To resolve the deprecation warning about whitespace between a mixin name and parentheses for a mixin call in Less, ensure there is no whitespace between the mixin name and the opening parenthesis. Your initial example is actually correct and should not trigger a warning:

    .divider-bottom(
      @spacing-top,
      @spacing-bottom,
      @border-width,
      @border-color
    );

    If you're still encountering warnings, it might be due to a bug or an issue with the specific version of Less.js you are using. The warning is intended to be triggered when there is whitespace directly between the mixin name and the parenthesis, like in .a ();, which is deprecated [1]. If the warning persists despite correct syntax, consider checking for updates or patches that might address this issue.

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

  2. puckowski commented on Apr 11, 2025

    @puckowski
    Contributor

    Thank you for the bug report. I'll see if I can take a look this weekend.

  3. matthew-dean commented on Apr 12, 2025

    @matthew-dean
    Member

    Oh oops. Yeah this shouldn't cause the warning.

  4. Y80 commented on Apr 16, 2025

    @Y80

    How to disable this warning❓❓❓

  5. Svish commented on Apr 22, 2025

    @Svish

    How to disable this warning❓❓❓

    Either remove the whitespace after the parenthesis as well, or wait for a fix. In our case, it was only a handful of issues, so I just fixed them all and warning is gone 👍

  6. puckowski commented on Apr 22, 2025

    @puckowski
    Contributor

    You can try the newer --quiet flag to suppress the deprecation warnings when compiling Less.

    @Y80

  7. hostep commented on Aug 29, 2025

    @hostep

    Any chance we'll see a fix for this soon-ish? Many thanks!

  8. puckowski commented on Aug 30, 2025

    @puckowski
    Contributor

    I'll try to take a look at this issue this weekend.

  9. puckowski commented on Aug 30, 2025

    @puckowski
    Contributor

    I think I have a fix in #4365

    If anyone wants to patch their Less parser and confirm the fix corrects the behavior I would appreciate it.

  10. hostep commented on Aug 31, 2025

    @hostep

    Looks good @puckowski!

    I just tried it in the ecosystem I'm active in, which is Magento2 ecommerce platform written in php, that uses less files for its frontend, and the amount of deprecated warnings dropped from 1220 to 39 after your changes, and those 39 seem like valid warnings. (example where warning went away, and example where warning still shows up, but that seems valid)

    Many thanks!

  11. puckowski commented on Sep 1, 2025

    @puckowski
    Contributor

    @hostep Thank you for testing!

  12. added a commit that references this issue on Mar 8, 2026
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