less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17.01k stars 3.41k forks source link

"math" option in compilerconfig defaults not working #3773

Open pmonty opened 1 year ago

pmonty commented 1 year ago

I am trying to compile some rather large files and was getting SyntaxError: Error evaluating function 'floor': argument must be a number in \assets\css\less\searchbox.less LRM C:\Projects\LRM\LRM\assets\less\custom.less 232

so added the math option always to my compilerconfig.json.defaults file:

{
  "compilers": {
    "less": {
      "autoPrefix": "",
      "cssComb": "none",
      "ieCompat": true,
      "strictUnits": false,
      "relativeUrls": true,
      "rootPath": "",
      "sourceMapRoot": "",
      "sourceMapBasePath": "",
      "sourceMap": false,
      "math": "always"
    },

but now I get: --math=always is deprecated and will be removed in the future.

I started a thread over here since it might be a visual studio thing but they told me to come here. https://github.com/failwyn/WebCompiler/issues/68

Less version: I imagine would be the latest stable as I installed the most recent version of the extension in visual studio Visual Studio 2022 Windows

iChenLei commented 1 year ago

cc @matthew-dean

pmonty commented 1 year ago

Also will just mention that according to these docs it should still be supported right? https://lesscss.org/usage/#less-options-math

pmonty commented 1 year ago

Was testing just by chance to unblock myself if any of the other options worked. They all showed other errors relating to the actual styling but no deprecated message.

pmonty commented 1 year ago

Little bit more investigation during some downtime and looks like its just a warning? https://github.com/less/less.js/blob/7491578403a5a35464772c730854c3a5169c0de7/packages/less/bin/lessc#L582 so why does my build fail then?

matthew-dean commented 1 year ago

This isn't possible to evaluate without seeing an example repo. The failure would be unrelated to the warning, unless you're using a build system that treats warnings as failures. @iChenLei can you add a requirement to bug reports that a reproducible example is provided?

iChenLei commented 1 year ago

@matthew-dean Ok, sir