ToastrModule is already loaded error after upgrade

web
mobile

Topic: ToastrModule is already loaded error after upgrade

pro asked 3 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.
We have a clear feedback about it so we will prioritize it.
Hi, it looks like you have "ToastModule" imported twice, so it's necessary to find duplicated declaration and remove it.

pro answered 3 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    
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.

nm_patrick pro answered 3 years ago

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

pro commented 3 years ago

No, the problem still exists in 4.3.1 pro

puGGz pro answered 3 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?

puGGz pro answered 3 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!
Hi, this will be fixed in the future.

pro answered 3 years ago

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

Dawid Adach pro commented 3 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.

Hosboss pro answered 3 years ago

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

Dawid Adach pro answered 3 years ago

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

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No