less.js icon indicating copy to clipboard operation
less.js copied to clipboard

"math" option in compilerconfig defaults not working

Open pmonty opened this issue 2 years ago • 6 comments

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

pmonty avatar Jan 16 '23 03:01 pmonty

cc @matthew-dean

iChenLei avatar Jan 16 '23 03:01 iChenLei

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

pmonty avatar Jan 16 '23 03:01 pmonty

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 avatar Jan 18 '23 22:01 pmonty

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?

pmonty avatar Jan 24 '23 05:01 pmonty

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?

matthew-dean avatar Mar 31 '23 20:03 matthew-dean

@matthew-dean Ok, sir

iChenLei avatar Apr 01 '23 03:04 iChenLei