Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I solve 'Web Compiler found an error in compilerconfig.json'?

Tags:

json

On trying to re-compile all files in a solution, using Visual Studio 2017, I get this uninformative error message:

Web Compiler found an error in compilerconfig.json

To begin with, there is more than one compilerconfig.json file in the solution.

Secondly, there is no indication whatsoever of what the error is, where it occurs (line number, for instance).

Any ideas how I can go about solving this?

like image 227
Steve Staple Avatar asked Jun 06 '17 08:06

Steve Staple


People also ask

How to run compilerconfig JSON?

You can run the compiler on all compilerconfig. json files in the solution by using the keyboard shortcut Shift+Alt+Y or by using the button on the top level Build menu.

What is a Web compiler?

A compiler is a computer program to execute that task. Typically, a compiler transforms code written in a higher-level language such as C++ or Rust or Java into executable (runnable) code — so-called binary code or machine code.


Video Answer


2 Answers

I was able to solve this issue for myself by using individual file compiling, instead of "All files".

I was getting a "Compiling successful!" message, but that didn't seem true because my compile file didn't contain my change. So here's what I did:

  1. Open Window > Task Runner Explorer. In your left column, there is a task for "All Files". That's fine. Ignore it.
  2. Compile your SCSS files individually. Do this by right clicking on each SCSS file in that list, and then Bindings > After Build. (Or add the task to whatever event you prefer. I chose After Build.)
  3. Open any SCSS file in your project and add a test. I added something like #TEST2 {color: hotpink;} to my SCSS file.
  4. Now when you save, your compiling takes a few seconds longer. Now open main.css and see if your change (#TEST2) exists in the file.

enter image description here

like image 22
anevaude Avatar answered Sep 30 '22 19:09

anevaude


In Visual Studio's Solution Explorer, right-click the compilerconfig.json file and click "Task Runner Explorer". In the left pane you will see "compilerconfig.json/all files", right-click on it and then click on "Run". You will see the details of the execution which, in my case, included the useful information about how to correct the error.

like image 101
Yepeekai Avatar answered Sep 30 '22 19:09

Yepeekai