The angular material dialog is not working in production build

我与影子孤独终老i 提交于 2021-01-29 08:09:59

问题


I am using angular 10 and angular material 10. the angular material dialogue is not working in the production build (ng serve --prod and ng build --prod) but It is working fine local dev environment (ng serve)

  1. I have already added the component in the entryComponents and bootstrap
  2. It is not throwing any kind of error in the console. what I can see is the card is loaded and no components inside the dialog are available,
  3. You can see the below screenshot, which is loading the card but not any component inside it.


回答1:


After a lot of research I found, the problem is with the IVY engine. For some people changing the below can solve the problem.
tsconfig.json

"angularCompilerOptions": {
    "enableIvy": true
  },

If you want to use the Ivy engine. the problem will be resolved if you update the Angular 10 project to Angular 11.



来源:https://stackoverflow.com/questions/65288802/the-angular-material-dialog-is-not-working-in-production-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!