Angular Compiler (ivy?) keeps complaining about used identifier/variable

Viewed 397

Every time I try to compile the project, this error pops up.

Error: ./node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/scrolling.js 23:12
Module parse failed: Identifier 'ɵngcc0' has already been declared (23:12)
File was processed with these loaders:
 * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
 * ./node_modules/@ngtools/webpack/src/ivy/index.js
You may need an additional loader to handle the result of these loaders.
| import * as ɵngcc3 from '@angular/cdk/collections';
| 
> import * as ɵngcc0 from '@angular/core';
| import * as ɵngcc1 from '@angular/cdk/platform';
| import * as ɵngcc2 from '@angular/cdk/bidi';

I have no idea where to begin debugging this. I have tried googling the error code but to no avail. Nobody else seemed to have this error before. Restarting ng serve does not solve the problem. I am using Angular 11 and Angular Material for the project.

How do I fix this and stop this error code from popping up?

1 Answers

I found also that:

closing VS Code, 
then deleting the node_modules, 
then opening VS Code
then running **npm install** worked.

Ian

Related