Share via


LESS in Web Compiler for Visual Studio 2019 stopped to work

Question

Wednesday, July 8, 2020 10:35 AM

It worked for years.

Yesterday for no reason (?) I'm not able to compile LESS files any more.

I tried to

  • reinstall the Web Compiler extension,
  • reinstall Web Essentials 2019 extension,
  • reinstall the whole Visual Studio 2019 for 3 times,
  • start a new project from scratch

I do not know if some automatic update happened under the hoods, but basically, every time I try to compile a LESS file I get:

module.js:471
    throw err;
    ^

Error: Cannot find module 'C:\Users\igor\AppData\Local\Temp\WebCompiler1.12.394\node_modules\less\bin\lessc'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3

Thanks for any help!

All replies (4)

Thursday, July 9, 2020 5:35 PM ✅Answered

Thanks for your feedback.
My first idea was to disable antiviruses and reinstall but it didn't work.

Another more elegant solution suggested by a stackoverflow user is to

  1. Uninstall Web Compiler
  2. Manually delete the WebCompiler1.12.394 folder
  3. Reinstall Web Compiler

It seems that the Web Compiler setup does not check for folder contents and if it founds the WebCompiler1.12.394 folder already in place, it lets it untouched.

The reason why some folder contents were missing will remain a mistery.


Thursday, July 9, 2020 5:21 AM

Hi Igor,

Welcome to MSDN forum.

From the error message, it seems the cause is missing corresponding module, and this issue may be related to name, path, configurations or extensions. I also notice that you use Web Compiler and Web Essentials extensions, I suggest you check the above aspects and try to communicate with publisher of these extensions.

Besides, not sure if this issue is caused by LESS, you can also try to ask this question on GitHub. Since you have tried reinstall Visual Studio and start a new project from scratch, I may not find a better solution. If possible, perhaps, you can try to use another machine to see if this issue still persists. If this issue still persists, I think this may be a potential issue, and you can directly report it to VS Product Team from Visual Studio > Help > Send Feedback > Report a Problem…

Feel free to contact me.

Best Regards,

Tianyu

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Thursday, July 9, 2020 7:29 AM

I discovered that the 

C:\Users\igor\AppData\Local\Temp\WebCompiler1.12.394\node_modules\less

has inside less files than expected, almost all sub folders are empty.

The only workaround I found, was to install Visual Studio (and extensions) on a clean PC and copy and paste all the files from the same aftermentioned folder.

It's not an elegant solution, but it works.

The cause is still unknown.
Who has to populate that folders?
The extension installation program?
The extension at runtime?


Thursday, July 9, 2020 10:01 AM | 1 vote

Hi Igor,

Thank you for your feedback.

>> Who has to populate that folders?

## I think it’s “the extension installation program”, I tested on my side and this folder was created after installing “Web Essentials 2019” extension.

## Actually, I doubt if some applications, for example anti-virus software, delete the sub folders.

Feel free to contact me.

Best Regards,

Tianyu

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].