Closed ranga-sriram closed 6 years ago
What version of ngx-tour-?? are you using?
I'm using ngx-bootstrap: ngx-tour-core@^2.0.0 ngx-tour-ngx-bootstrap@^2.0.0-beta.9
I read that due to dynamic component creation one would have to add entryComponents property to @NgModule. I did the following for my tour module but it still fails on production. I tried moving that to main module as well. Failed there as well.
@NgModule({
imports: [
TourNgxBootstrapModule
],
declarations: [
TourMainComponent
],
entryComponents: [
TourMainComponent
]
})
export class TourModule { }
I would like to mention that the plugin works when using ng build
alone. Whereas it is only when using the prod flag ng build --prod
that the error throws up. Would you think it might be due to tree shaking or minification?
Hi @isaacplmann, would you have any suggestions on this issue? It's been a blocker to make a minified build version. Can you suggest any lower version of ngx-tour-core and ngx-tour-ngx-bootstrap that might not have this problem?
I'm able to build using aot on ngx-tour-ngx-bootstrap@^2.0.0
(which is higher than 2.0.0-beta.9). You also don't need to include ngx-tour-core
yourself - it is packaged with ngx-tour-ngx-bootstrap
.
Thanks for your suggestion @isaacplmann. It works now with 2.0.0. Unfortunately for my project, since I have already been working with 2.0.0-beta.9 I cannot change to a new version until the next release.
Would you know if there is something that I can do in my code (i.e. app folder and not npm_modules) to fix the issue in 2.0.0-beta.9 ?
Try running ng build --aot
. That at least should give you a non minified error that you can try to handle
Thanks @isaacplmann. I tried your suggestion, throws up error that PopverContainerComponent is missing component factory and needs to be included in entryComponents. Tried fixing that, which leads to more errors. I find that PopverContainerComponent is actually already included in entryComponents of PopoverModule. I'm not sure why this error would come up in the first place.
Would you know if this is something related to the umd files and AOT compilation?
Since you're using the angular cli, the umd files don't affect you.
Thanks @isaacplmann for all your help. Will close this issue now since higher version ngx-tour-ngx-bootstrap@2.0.0 works fine.
while doing ng serve the tour works fine and the modal shows up. But when I do
ng build --prod
I get the attached errors in console. Would you know why these happen in prod mode?