opdahlmann / ng2-opd-popup-sample

4 stars 13 forks source link

Getting Error in lazy loading : It seems ng2-opd-popup-sample is importing BrowserModule #17

Open nileshyadav326 opened 6 years ago

nileshyadav326 commented 6 years ago

ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead. Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.

nileshyadav326 commented 6 years ago

fixed anyone can use download this module.

https://drive.google.com/open?id=1d49CCmOKxO9up5Ja4mz8lVDO2q_Jo-_P

quan-shi-au commented 6 years ago

Thanks for a lot for fixing it @nileshyadav326 . But it only works for development build not production build.

it works if I run "ng build", but I got same error if I run "ng build --prod"

nileshyadav326 commented 6 years ago

can you share the screenshot of error?

quan-shi-au commented 6 years ago

Environment and settings:

Following are the steps:

error_ng2-opd-popup

gtreminio commented 6 years ago

Hi @nileshyadav326. Do you have an update on this? I´m seeing the same error mentioned above running in --prod mode. Appreciate your help.

gtreminio commented 6 years ago

I manage to fix it by changing: "arguments":[{"imports":[{"symbolic":"reference","module":"@angular/platform-browser","name":"BrowserModule"}] to: "arguments":[{"imports":[{"symbolic":"reference","module":"@angular/common","name":"CommonModule"}]

in popup.module.metadata.json