-
Notifications
You must be signed in to change notification settings - Fork 12k
[AOT] [Lazy Loading] Error: Cannot find module './routes/home/home.module.ngfactory'. #8597
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
Hi, is there something wrong with your repository https://github.com/strongpauly/angular-5-aot-lazy ? [EDIT] |
So there is no way to use lazy routes with aot at all ? |
In your
You are telling Webpack that lazy modules loaded from Just remove this plugin and the lazy chunks (
Note: I wasn't able to test your app in the browser because your npm scripts don't work on windows, but I tested |
@filipesilva Thankyou for your speedy response, and yes this was the issue. Chunks are now being created and loaded. Apologies for wasting your time. |
I'm on gitbash as well but I couldn't get the Regardless, glad to hear that sorted it for you! |
I am facing the same issue. The lazy loaded modules are not rendered on the server. What I understood from above discussion is that the chunks for the server bundle is not getting generated as I have the chunks in the browser bundle. Any help is much appreciated. Edit |
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. |
Versions
Repro steps
Apologies if this is a duplicate, or a simple configuration issue, but I really can't progress this any further myself. During an attempt to convert our project into an AOT production build I have run into these errors. I have created a stub version of it here to demonstrate the issue: https://github.com/strongpauly/angular-5-aot-lazy
Installing this project and compiling using JIT works as expected - the two routes, root (or home) and lazy, load correctly.
Using AOT causes the below error message when navigating to the root url.
Observed behavior
Error thrown.
Desired behavior
AOT should load routes lazily in the same way as JIT.
This may have been easier to debug, either with actual documentation specific to ngtools/webpack or with a way to output intermediate files on a failure, but I see there is a separate issue for that.
The text was updated successfully, but these errors were encountered: