Angular 8 Lazy Loading Syntax Not Working

后端 未结 4 1367
时光说笑
时光说笑 2021-01-11 23:59

I\'m trying to implement Lazy loading into my Angular 8 application but when I use the syntax provided in the official doc, my module gets loaded eagerly.

When I use

4条回答
  •  情歌与酒
    2021-01-12 00:48

    After a lot of digging between trying to provide a minimal reproducible example, trying to update all my packages or reinstalling them, and simply digging through all my files and try to find what was wrong, I managed to fix the issue.

    I essentially re-upgraded my app to angular 8 as if I was using angular 7 (even tho I was supposedly already using angular 8) using the commands ng update @angular/cli --from 7 --to 8 --migrate-only ng update @angular/core --from 7 --to 8 --migrate-only as mentionned in this thread

    This updated all the old syntax of lazy loading to the new one automatically and on building/serving I could finally see all the chunks for each module

    Given that it was fixed with these commands, I believe the issue was with packages/dependencies somewhere.

提交回复
热议问题