I already spent about 10 hours around this error:
ERROR in ./src/main.ts
Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class.
This likely means you have several @ngtools/webpack packages installed. You can check this with `npm ls @ngtools/webpack`, and then remove the extra copies. at Object.ngcLoader (C:\PRO\ANG\Cezar\CezarBot\Ajuro.Client\node_modules\@ngtools\webpack\src\loader.js:33:15)
ERROR in ./src/polyfills.ts
Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class.
This likely means you have several @ngtools/webpack packages installed. You can check this with `npm ls @ngtools/webpack`, and then remove the extra copies. at Object.ngcLoader (C:\PRO\ANG\Cezar\CezarBot\Ajuro.Client\node_modules\@ngtools\webpack\src\loader.js:33:15)
I added image because is easier to be recognized. In my attempts to solve it I updated node, I reinstalled webpack, I reinstalled @angular/cli, @ngtools/webpack, cleared the cache with --force, run npm install. I also reinstalled the global @angular/cli.
At some points I ended up with one or no @ngtools/webpack versions in local node-modules or in %appdata%/npm. The error was the same.
I think it is not related to @ngtools/webpack How can I investigate?