Topic: ToastrModule is already loaded error after upgrade

stalis pro asked 6 years ago


Hi Support, Before the upgrade to 4.2.0 pro, my application was working with version 4.1.0 And now I am getting an error of ToastrModule is already loaded. It should only be imported in your application's main module. But my application does not use this module.

Dawid Adach pro answered 6 years ago


Dear all, please find a solution within this post thread: https://mdbootstrap.com/support/bug-with-the-lazy-loading/

Adrian Sawicki free answered 6 years ago


We have a clear feedback about it so we will prioritize it.

Hosboss pro answered 6 years ago


Hello, Will this problem be solved soon, without it mdb angular is unusable for me. Thank you

stalis pro answered 6 years ago


Hi Support, I am using mdb-angular-pro-4.3.5 but this problem still exists.  

Dawid Adach pro commented 6 years ago

Dear, Recently we have released few small fixes to make use of npm for both free and pro version. We didn't do any code change, though. Once we will fix it we will make a proper note in our changelog. My apologies for your inconvenience.

Edyta Dabrowska free answered 6 years ago


Hi, this will be fixed in the future.

puGGz pro answered 6 years ago


i was able to fix my problem through a shared module. but still i needed to get rid of ToastModule references in various mdbootstrap index files. everything else is working. please fix!

puGGz pro answered 6 years ago


i got the same problem with lazy loaded modules. i'm also not using toast module. is it wrong to import mdbootstrap in app.module and several other modules which get lazy loaded?

nm_patrick pro answered 6 years ago


Has this been resolved, I'm having the same error with lazyloaded modules...

stalis pro commented 6 years ago

No, the problem still exists in 4.3.1 pro

Magdalena Obalska free answered 6 years ago


Ok, could you send me your package? It will be much easier to investigate what could go wrong. Here's my e-mail address: m.obalska@mdbootstrap.com.

stalis pro answered 6 years ago


Hi, To get my app to work again, I had to comment out a few lines in the src\app\angular-bootstrap-md\pro\index.js file and they are line 26, 46 and 73. All the commented line is related to ToastrModule. As I said before, I do not use ToastrModule in my app and it was working perfectly in version mdb-angular-pro 4.1.0 Just to let you know in my app module I import the MDBBootstrapModulePro like this: MDBBootstrapModulePro.forRoot() and in my lazy loaded module, I also import MDBBootstrapModulePro but without .forRoot() I believe the new version 4.2.0 pro changes which will cause this error when importing MDBBootstrapModulePro in the lazy loaded module but this was working fine in version mdb-angular-pro 4.1.0 Can you please investigate? Many thanks    

Magdalena Obalska free answered 6 years ago


Hi, it looks like you have "ToastModule" imported twice, so it's necessary to find duplicated declaration and remove it.

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

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