1

Al tratar de importar import { MatTableModule } from '@angular/material/table'; me marca el siguiente error: Cliente Angular: 11.2.3 @angular/material: ^11.2.4 @angular/cdk: ^11.2.4

Error: ./nodemodules/@angular/material/__ivy_ngcc__/fesm2015/table.js 22:12

Module parse failed: Identifier 'ɵngcc0' has already been declared (22: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 ɵngcc1 from '@angular/cdk/table'; |

import * as ɵngcc0 from '@angular/core'; | const _c0 = [[["caption"]], [["colgroup"], ["col"]]]; | const _c1 = ["caption", "colgroup, col"];

Error: ./node_modules/@angular/cdk/ivy_ngcc/fesm2015/table.js 9:12 Module parse failed: Identifier 'ɵngcc0' has already been declared (9:12)

  • ./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/scrolling'; |

import * as ɵngcc0 from '@angular/core'; | import * as ɵngcc1 from '@angular/cdk/bidi'; | import * as ɵngcc2 from '@angular/cdk/platform';


Sin embargo tengo importadas estas librerias y no me dan problema:

import { MatButtonModule } from '@angular/material/button';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatIconModule } from '@angular/material/icon';
import { MatBadgeModule } from '@angular/material/badge';
import {MatCardModule} from '@angular/material/card';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { MatRadioModule } from '@angular/material/radio';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatListModule } from '@angular/material/list';

1 respuesta 1

1

Me sucedía el mismo problema. Lo que hice para solucinarlo fue:

  • Eliminar la carpeta node_modules
  • Reinstalar usando el comando npm instal
1
  • Si gracias, lo solucioné muy parecido reinstalando esas librerías: npm install --save @angular/material @angular/cdk Commented el 24 mar. 2021 a las 18:49

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.