Topic: TastModule already loaded

tomrei pro asked 7 years ago


Hello MDB-Team,

when using the latest version (4.3.1) of mdb pro, I get following error: (I integrated it in an existing project, following this guide: https://mdbootstrap.com/support/installing-mdb-angular-4-in-existing-angular-cli-project/)

Unhandled Promise rejection: ToastModule is already loaded. It should only be imported in your application\\\'s main module. ; Zone: angular ; Task: Promise.then ; Value: Error: ToastModule is already loaded. It should only be imported in your application\\\'s main module.

Imports in app.module:MDBBootstrapModule. forRoot()MDBBootstrapModulePro. forRoot()I also imported it in the module where I want to use it (but without forRoot()).When i don\\\'t import it in the this module, the components are not recognized.

There is no directive with \\\"exportAs\\\" set to \\\"mdb-modal\\\" (\\\"<div mdbModal [ERROR ->]#deleteDashboardModal=\\\"mdb-modal\\\" class=\\\"modal fade\\\" id=\\\"centralModalSuccess\\\" tabindex=\\\"-1\\\" role=\\\"dia\\\"): ng:///DashboardModule/DashboardComponent.html@100:14 ; Zone: angular ; Task: Promise.then ; Value: Error: Template parse errors:There is no directive with \\\"exportAs\\\" set to \\\"mdb-modal\\\" (\\\"</div>

What can I do about it? Is my installation wrong?


nm_patrick pro commented 7 years ago

+1

michael.kania pro answered 7 years ago


Is there a better solution? I have The same error.

Dawid Adach pro commented 7 years ago

Dear Michael, this was fixed in 4.3.7 release, please refer either to changeloge: https://mdbootstrap.com/angular/changelog/ or Alerts documentation: https://mdbootstrap.com/javascript/alerts/

stalis pro answered 7 years ago


I am having the same problem and I have already raised a support too. This only happens to me when I have lazily loaded module but not eagerly loaded module. Please, can this be fixed?  

stalis pro commented 7 years ago

To get my project going, I had to comment out any line that has ToastModule in the /typescripts/pro/index.ts file to work. Support please fix this.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No
Tags