Topic: Issue with SSR aka Universal

fellah pro asked 6 years ago


Hi I followed the instructions and did all steps from angular/angular-universal. Unfortunately, after that I found errors in my logs such as below:
ERROR [Error]
client_1 | NavigationError {
client_1 | id: 1,
client_1 | url: '/',
client_1 | error: ReferenceError: System is not defined
client_1 | at SystemJsNgModuleLoader.loadFactory (/node_modules/@angular/core/bundles/core.umd.js:6628:9)
...
I believe it has to do with the dirty hack from step 9, appending window to the global scope. The error appears on every refresh of browser, on every served url. Furthermore, I had to convert my regular home component into lazy-loaded, because the page doesn't load properly. I saw a blank screen and above error. Any idea how to fix or how to investigate it? I haven't succeeded getting more info than ERROR [Error]

Damian Gemza staff commented 6 years ago

Dear fellah, We're working on provide users new Universal Guide which will be compatible with Angular 6. I'll let you know about it. Best Regards, Damian

Damian Gemza staff commented 6 years ago

Dear fellah, Here's the updated Universal Guide: https://mdbootstrap.com/angular/angular-universal/ Could you try with this guide and check if problems exists? If yes, please provide me reproduction steps. Best Regards, Damian

fellah pro commented 6 years ago

Thank you Damian for letting me know. Unfortunately, I've got still the same issue. But when I changed one lazy-loaded module to a regular, I wasn't able to load that page at all, getting: ERROR TypeError: button.getBoundingClientRect is not a function, whereas other pages started to work normally without any errors. The same type error appeared when I've imported ModuleMapLoaderModule as written here: https://github.com/angular/universal/tree/master/modules/module-map-ngfactory-loader.

Damian Gemza staff commented 6 years ago

Dear fellah, Could you give me reproduction steps to reproduce your case? The problem exists only when you want to use Lazy Loading with Universal? Or in which other situation? I'm unable to reproduce your problem, so waiting to hear something from you Best Regards, Damian


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: Yes
Tags