Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to configure Server side rendering for lazy loaded routes using angular universal and firebase hosting?

I followed the tutorial of david east to make an angular universal app and deploy it on firebase hosting. I tried this and it worked with normal routes but with lazy loaded routing it did not work. here is the screen shot of the view page source, view page source

why this is not working when routing? Can someone tell me how to configure Server side rendering for lazy loading or share any links about it?

like image 316
Karty Avatar asked Nov 18 '22 07:11

Karty


1 Answers

You can check this guide from the official Angular CLI docs how to make lazy loading work if you do ssr with the angular cli. It's the same method as in your video tutorial.

However, until few days ago, it had the following statement at the bottom which was saying:

Caveats

  • Lazy loading is not yet supported, but coming very soon. Currently lazy loaded routes aren't available for prerendering, and you will get a System is not defined error.

If you look at the revision history, you can see that it just was changed to revision 1.5.0-beta.4. Probably you have to upgrade your CLI to that version to make it work that way.

like image 159
Moema Avatar answered Dec 05 '22 19:12

Moema