Tuesday, June 2, 2020

[Error Solved]: @angular/material/index.d.ts' is not a module

Here in this article I am going to explain how to resolve the @angular/material/index.d.ts' is not a module error.

 

After upgraded currently working Angular application to Angular 9 and Angular Material 9, I get the error :

@angular/material/index.d.ts' is not a module

 

Now the question arise why this error comes and how to fix this error.

 

Reason:

From Angular 9 we can’t import the Angular Material components directly through @angular/material. All components would be loaded from their individual path.

 

 Solution:

Import the components from their specific path or downgrade the Angular Material.

Example I want to import the matcard, I have to write full path @angular/material/card instead of @angular/material.

 

import {MatCardModule } from '@angular/material/card';

No comments:

Post a Comment