-
Notifications
You must be signed in to change notification settings - Fork 518
Lazy loading doesn't seem to be working #1194
Comments
I managed to find the cause of the error. First of all, it was incorrect of me to try and use So in order to use Lazy Loading in dev mode, I had to I added a PR which fixes it. |
We can't make any updates until the next quarter to the templates provided with dotnetcore 2.0, right @SteveSandersonMS ? It'd be nice to have |
Thanks for reporting this! Closing this one in favour of #1195.
We can make changes in the repo here any time, but when they actually ship in an updated .NET SDK depends on the .NET SDK shipping schedule :) |
Excellent, yeah that's what I figured, great 👍 |
Previously, the AngularSpa didn't include `angular2-router-loader`. This commit ensures it does. Closes #1194
Yes, had this problem. Glad I found this thread.... Dropped in the code as per #1195. Worked like a charm! |
It seems that angular2-router-loader is now angular-router-loader. But I tried to install angular-router-loader by following the instructions mentioned at https://www.npmjs.com/package/angular-router-loader, but it didnt work. It seems that this package has a dependency on loader-utils , which npm was unable to install. Can you please take a look? |
I used the same template ASP.NET Core 2 & Angular in VS 2017 with lazy loading. It works good in dev mode after adding angular2-router-loader, it passes the production build (dotnet publish -c Release) but when deployed on Azure App Service I get the same error (ERROR Error: Uncaught (in promise): Error: Cannot find module './product/product.module.ngfactory'.). webpack.config.js has the following line:
Doesn't this mean that ngtools/webpack causes the problem? Is there any workaround for this? |
@chsakell I have exact the same problem, dev build mode fine, production build builds fine but as soon as I start the generated project and call my lazy module I get the same error... did you find a solution? |
Yes @fen89 , just use the same config for both dev and prod in webpack.config.js. { test: /\.ts$/, include: /ClientApp/, use: ['awesome-typescript-loader?silent=true', 'angular2-template-loader', 'angular2-router-loader'] }, That worked for me. |
Is there any solution to this? I'm having the same problem today for the past 1 week.. |
We have the exact same problem with angular 6.1 AspNet Core and Azue App Service. @darlontrofy did you find a solution? |
Try the new template. |
Hi,
I've been looking into ASP.NET Core 2.0 and the Angular template available in VS 2017.
A fresh install works fine, but it looks like there's no example using lazy-loading.
I wanted to try implement it based on 7ded0a0 .
In order to do so I've created a repository (using the default starter from VS2017) and added the following commit: https://github.com/frederikprijck/aspnet-angular-lazy-loading/commit/0edaa0889e1084dfad47d1674641b86c0e45332c
Note: I've disabled development build to ensure
@ngtools/webpack
was used.Running the project available in the repository (https://github.com/frederikprijck/aspnet-angular-lazy-loading) results in the following error when navigating to
counter
.Does the template require more changes in order to enable Lazy Loading?
Thanks
The text was updated successfully, but these errors were encountered: