Getting "No component factory" error while opening a Material Dialog in lazy loaded Component
See original GitHub issueHi,
Im getting the following error when i try to open Material Dialog in ConfirmBoxComponent.
No component factory found for ConfirmBoxComponent. Did you add it to @NgModule.entryComponents?
I have already added ConfirmBoxComponent in entryComponents list
    declarations: [
      ConfirmBoxComponent
    ],
    exports: [ConfirmBoxComponent],
    entryComponents: [
      ConfirmBoxComponent
    ],
The module that contain ConfirmBoxComponent is loaded via Lazy loading technique.
I’m not sure this is bug or not.
I’m using latest version of Angular and Material
   "@angular/core": "^5.0.0",
  "@angular/material": "^5.0.0-rc0"
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (3 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
Angular : Getting "No component factory" error while opening ...
The module that contain ConfirmBoxComponent is loaded via Lazy loading technique. I'm using latest version of Angular and Material. "@angular/ ...
Read more >Angular Dynamic Components: Building a Dialog System
To get started, let's create an empty dialog component. This component will consist of a white dialog area, while the rest of the...
Read more >Lazy-load a component in Angular without routing
One of the most seeking features in Angular is to lazy load a component when you need it. It is a very straightforward...
Read more >No component factory found for... Opening a Modal-angular.js
For opening a component in a modal, you have to add the component in the app.module.js as a entryComponent . Your error message...
Read more >angular/material2 - Gitter
Loading @angular/material/bundles/material.umd.js ... I am getting this error. ERROR Error: No component factory found for DialogCreatePickupComponent.
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

You need to import
MatDialogModuleinConsumerModulein order for it to know about theentryComponentsthereIn regards to Angular v6+: in case anyone is using the
MatDialogservice inside another injectable service and is using the{ providedIn: 'root' }option for that service, you’ll need to instead provide that service in theprovidersarray of the module where your dialog components are declared.