Skip to content

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

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

Open
egonolieux opened this issue Apr 11, 2025 · 6 comments
Labels

Comments

@egonolieux
Copy link

egonolieux commented Apr 11, 2025

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.

@egonolieux egonolieux added the bug label Apr 11, 2025
Copy link

dosubot bot commented Apr 11, 2025

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

@puckowski
Copy link
Contributor

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

@matthew-dean
Copy link
Member

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

@Y80
Copy link

Y80 commented Apr 16, 2025

How to disable this warning❓❓❓

@Svish
Copy link

Svish commented Apr 22, 2025

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 👍

@puckowski
Copy link
Contributor

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

@Y80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants