You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Hello.
i have a project with many modules and components. i am using lazy loaded modules in my project and for universal i am using the ModuleMapLoaderModule.
some of the routes in my project are relevant to seo and also users might navigate to them directly however some routes are user specific routes and therefore not relevant to seo. the routes which are user specific include complicated components with many 3rd parties which does not support angular universal so in my project i have different root modules for the server side and browser side (as shown here: "https://github.com/samvloeberghs/ng-universal-demo/tree/master/src/app") with different routes for each one of them. in the server module i only include the routes which are relevant to seo and for all other routes i display some general "please wait" route. the browser module include all routes off course.
this project works great in angular 4 how ever after upgrading to angular 5 suddenly i am receiving errors when i start the node server regarding the components which are not part of the server routes. i receive the "window is not defined" errors and so on from the 3rd parties. the error appears even before i navigate to the any route (as soon as i start the node server). it seems that when running the node server it tries to run or read all the components in the project and it encounter the problematic components.
i cant use the regular approach of isBrowser because i am using many 3rd parties and it will force me to make too many changes in the user specific components. since these components are not relevant to server i just want to ignore then i server side rendering.
is this is a change in angular 5 or that this is a bug (that components which are not relevant to server side rendering raise issues)?
is there a way to work as in angular 4 where these components are not relevant until the app is running in the browser?
Thanks Yosi
The text was updated successfully, but these errors were encountered:
yosigolan
changed the title
After upgrade to angular 5 components that are only part of browser router still being counted and produce errors
After upgrade to angular 5 components that are only part of browser route still being counted and produce errors
Nov 5, 2017
Hello.
i have a project with many modules and components. i am using lazy loaded modules in my project and for universal i am using the ModuleMapLoaderModule.
some of the routes in my project are relevant to seo and also users might navigate to them directly however some routes are user specific routes and therefore not relevant to seo. the routes which are user specific include complicated components with many 3rd parties which does not support angular universal so in my project i have different root modules for the server side and browser side (as shown here: "https://github.com/samvloeberghs/ng-universal-demo/tree/master/src/app") with different routes for each one of them. in the server module i only include the routes which are relevant to seo and for all other routes i display some general "please wait" route. the browser module include all routes off course.
this project works great in angular 4 how ever after upgrading to angular 5 suddenly i am receiving errors when i start the node server regarding the components which are not part of the server routes. i receive the "window is not defined" errors and so on from the 3rd parties. the error appears even before i navigate to the any route (as soon as i start the node server). it seems that when running the node server it tries to run or read all the components in the project and it encounter the problematic components.
i cant use the regular approach of isBrowser because i am using many 3rd parties and it will force me to make too many changes in the user specific components. since these components are not relevant to server i just want to ignore then i server side rendering.
is this is a change in angular 5 or that this is a bug (that components which are not relevant to server side rendering raise issues)?
is there a way to work as in angular 4 where these components are not relevant until the app is running in the browser?
Thanks Yosi
The text was updated successfully, but these errors were encountered: