Ngx-toastr: Error on lazy loaded module that ToastrModule has already been loaded but it hasn't.

Created on 7 Apr 2018  路  3Comments  路  Source: scttcper/ngx-toastr

I get the following error:
Error: ToastrModule is already loaded. It should only be imported in your application's main module.

I did a ctrl-f on my project and confirmed its only getting loaded in my shared module. When I hit the lazy module the error pops up.

Is this happening because I'm loading it in a shared module instead of app.module.ts? Should that matter? I bundled it up with my shared module so I wouldn't have to pollute something like app.module.ts

Most helpful comment

It shouldn't be imported in a shared module. It needs to be imported into a module that only gets imported once. Something like a CoreModule or simple the AppModule

All 3 comments

It shouldn't be imported in a shared module. It needs to be imported into a module that only gets imported once. Something like a CoreModule or simple the AppModule

Same as #415

Closing as this is a duplicate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MrBlaise picture MrBlaise  路  7Comments

jschneiders picture jschneiders  路  7Comments

sabeehshah picture sabeehshah  路  4Comments

picninim picture picninim  路  6Comments

harikrishnan-u01 picture harikrishnan-u01  路  6Comments