-
Notifications
You must be signed in to change notification settings - Fork 12k
$$_lazy_route_resource lazy recursive #9775
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
I have the same problem |
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please? The content of those 3 files is not enough to reproduce. You can read here why this is needed. A good way to make a minimal repro is to create a new app via |
In your app.module.ts, did you import ListModule before AppRoutingModule ? I faced same issue, and was able to fix it by reordering imports From the doc, imports order matter : https://angular.io/guide/router#module-import-order-matters |
@ydomenjoud you are not supposed to import ListModule, as the module will be lazy-loaded. |
i removed all imports of "lazy-loading" modules from AppModule and it fixed the problem! Thnx @ydomenjoud |
@vannhi yeah you right, it was just to get if the issue was about wrong import. |
I have the same problem, but thats happen when i run the project without the option --aot, if i build the project or run ng serve --aot that not happen |
For now downgrading the Angular-CLI to version 1.6 works Looking forward to see a better solution. |
I'm having the same issue. Using |
@slavik-chapelskyi When lazy loading a module, you SHOULD NOT DECLARE them in the app module, otherwise it becomes eagerly loaded. |
@filipesilva When I do
Step 2: When I click on go to survey, it generate the big issue of this topic. |
update cli to 1.7.2 seems can solve this problem. |
@radonirinamaminiaina See https://stackoverflow.com/questions/48947314/lazy-load-angular-5-error-lazy-route-resource-lazy-recursive/49165399#49165399 for steps to fix this issue. @cuiliang is correct, 1.7.2 fixes your primary issue. I'm not sure what your issue is in step 1, but i'd be willing to wager some sort of project setup issue. Hope that helps! |
Duplicate of #9488. |
@radonirinamaminiaina ran into your error in step 1 again in a different project and found that https://stackoverflow.com/a/47605359/266426 fixed it. Remove node_modules and package-lock.json and run npm install. Good luck! |
Using -aot I got a more user friendly error message which leaded to the issue quickly. |
I am working on this issue too. I posted a stackoverflow question about it, but as of now, have no answers: |
Above comment help me a lot. This is what I have fixed into AppModule (1) LayoutModule, // Must be before app routing this might help someone. |
Hi all, This issue is a bit old at at this point and I'm not really sure if this is still a problem. There's a lot of comments with suggestions and users saying they've fixed it one way or another, and also some saying they still have a problem. If you still suffer from this problem please open a new issue with a reproduction and we'll look at it. |
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. |
Note: for support questions, please use one of these channels: Chat: AngularClass.slack or Twitter: @AngularClass
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
What is the current behavior?
I got
TypeError: __webpack_require__.e is not a function
after trying to make a lazy load module.My Code
app-routing.module.ts
list-routing.module.ts
list.module.ts
app.module.ts
The text was updated successfully, but these errors were encountered: