WebCompiler
WebCompiler copied to clipboard
"math" option in compilerconfig defaults not working
Installed product versions
- Visual Studio: 2022 Enterprise
- This extension: 1.14.10
Description
Getting the following error on compilation
--math=always is deprecated and will be removed in the future.
with the following config in compilerconfig.json.defaults
"less": {
"autoPrefix": "",
"cssComb": "none",
"ieCompat": true,
"strictUnits": false,
"relativeUrls": true,
"rootPath": "",
"sourceMapRoot": "",
"sourceMapBasePath": "",
"sourceMap": false,
"math": "always"
},
Anyone know what the issue might be?
I don't see it mentioned in their changelog, but I would ask the developers of less.js
https://github.com/less/less.js
started a thread over there but no response yet. What version of less does this extension use?
@pmonty
"less": "^4.1.3",
"less-plugin-autoprefix": "^2.0.0",
"less-plugin-csscomb": "^0.0.2"
@failwyn just commented in my less.js issue and noticed it is a warning that is thrown. But this compiler extension is giving me
C:\Projects\LRM\LRM\assets\less\custom.less : WebCompiler error 0: --math=always is deprecated and will be removed in the future.
is it possible this extension treats warnings as errors? and is there a way to change this?
It's possible, I haven't been through all of the source, but I can dig around and take a look.
Edit: based on the code, it doesn't look like this is the case, but I will try to get time to setup a use case to step through it asap.
if (result.Errors.Any(e => !e.IsWarning)) return result;
Yeh noticed that line of code and started thinking it might be something else instead. Yeh if you get a chance let me know what the result is.
Cause I just found the error line it seems to be throwing https://github.com/madskristensen/WebCompiler/blob/c01fbbf785ea16a9b8784b1697e3095c3ffd0596/src/WebCompiler/MSBuild/CompilerBuildTask.cs#L59 so that makes me think that isWarning or logic around there is doing something maybe incorrectly.
That line logs Errors and Warnings, but doesn't throw anything, so it shouldn't affect the result.
Strange that the warning message in less is thrown as an error. Might wait to hear from the less team and go from there.
Is it a better option to maybe use something other than "always" and then fix up issues? But in saying that there might be hundreds of errors.
Is it possible for me to compile a certain version of this and install that specific version manually? Maybe then I can try have logic if the error contains "always" then allow it to skip.
I don’t really want to start introducing hacks to support deprecated parts of the LESS library; if the authors don’t want to support math=always, I’d say the best option would be to update the LESS files to be compliant or install an older version of WebCompiler and turn off automatic updates; there’s always going to be issues with backwards compatibility, but I feel like supporting the current language versions is more important.
Is there a way to install a specific version in visual studio? Or do I need to clone this repo and make necessary changes then build?
There's supposedly a way to browse Version History on Visual Studio Marketplace, but I can't find it; try this version.
https://marketplace.visualstudio.com/_apis/public/gallery/publishers/Failwyn/vsextensions/WebCompiler64/1.14.8/vspackage
// to download older versions, just change the version number in the url