-
Notifications
You must be signed in to change notification settings - Fork 12k
Why is Angular Lazy loading and routing not working after migrating to Angular 6 ? #19092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hasn't |
@destus90 Isn't that a feature introduced in angular 8 and 9? Will it work for angular 6? |
@kunal00731 would you have a repo to share in order to test it? |
@geromegrignon Unfortunately , I cannot as it's restricted code . However, I can provide excerpts if required . |
Hi @kunal00731, Without a minimal reproduction it hard to tell what is the cause of the problem you are experiencing. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. It's also important to point out Angular version 6 is no longer under support https://angular.io/guide/releases#support-policy-and-schedule. The current LTS version is version 8 which will end in November 28, 2020. |
@alan-agius4 @destus90 @geromegrignon
The devkit used in angular.json for doing build and serve is causing some kind of issue in compilation . It is not compiling in a lazy loaded fashion and the compilation is extremely fast (the app is quite big; in Angular 4 it took some time to cmpile the lazy loaded modules). However I am not getting any error . |
@kunal00731, since version 6 which was released 2 years ago a lot has changed. The issue you are experiencing might very well the fixed in a more recent version. Without a reproduction we cannot determine what’s the root cause or if the issue has been already been solved. My recommendation at this point is to update to a more recent version (make sure to use If you cannot update to a more recent version, try to make a minimal reproduction of the problem using As mentioned previously Angular 6 is no longer supported by the Angular team the current LTS version is 8. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
In my application , lazy loading was perfectly working in Angular 4 and 5 . However , after I migrated to Angular 6 , the lazy loading and routing has stopped working when I use ng serve.
The routes for the application are defined in
app.module.ts
like this :I have gone through a lot of articles on the internet about this and tried out a lot of things , but none worked . While migrating from angular 5 to 6, a lot of configurations in the old code got changed like :
angular-cli.json
got changed toangular.json
. Lot of packages inpackage.json
got upgraded and 2 new packages got introduced :@angular-devkit/build-angular
andrxjs-compat
. The package :@angular-devkit/build-angular
seems to be utilized by theangular.json
for build and serve . I am not understanding why the migration has broken the routing and lazy loading .Can someone please help me out here ?
My
Package.json
dependencies are listed below :The text was updated successfully, but these errors were encountered: