MatDialog Error: No provider for InjectionToken mat-dialog-scroll-strategy

This error also happens if you try to open dialog of a lazy loaded module from service with @Injectable({providedIn: 'root'}).

To fix it you have to either move that dialog to main module or remove providedIn notation and add it as provides: [] in lazy loaded module.


You need to include MatDialog Module in the imports.

import {MatDialogModule} from '@angular/material';
@NgModule({
   imports :[MatDialogModule],
   ...
})