'Error when trying to use @angular/material in Stackblitz
On stackblitz, when trying to add import to Angular Material , like this:
import { MatCheckboxModule } from '@angular/material';
This is the error:
File '/turbo_modules/@angular/[email protected]/index.d.ts' is not a module.
Here link to stackblitz https://stackblitz.com/edit/angular-ivy-11rird?file=src%2Fapp%2Fapp.module.ts
Solution 1:[1]
Added like this
import { MatCheckboxModule} from '@angular/material/checkbox';
Now it is working.
Solution 2:[2]
In the project on stackblitz, he also cursed at material. As it turned out, it does not install dependencies correctly. Working option:
import { MatTableModule } from '@angular/material/table';
import { MatSortModule } from '@angular/material/sort';
import { MatPaginatorModule } from '@angular/material/paginator';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Sarah Jung |
Solution 2 | Marisha-tech |