Skip to content
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

Infinite loop during preload if router configuration missed in preloaded module #29164

Closed
xuemind opened this issue Mar 7, 2019 · 2 comments
Closed
Labels
area: router freq3: high P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent router: lazy loading state: confirmed type: bug/fix
Milestone

Comments

@xuemind
Copy link

xuemind commented Mar 7, 2019

🐞 bug report

Affected Package

The issue is caused by package @angular/router

Is this a regression?

Don't know

Description

Module preloading process is stuck in infinite loop until maximum call stack size exceeded if preloaded module missing router configuration file.

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-issue-repro2-x4hkgg

🔥 Exception or Error




ERROR RangeError: Maximum call stack size exceeded
    at InnerSubscriber.Subscriber.error (Subscriber.ts:115)
    at MapSubscriber._next (map.ts:83)
    at MapSubscriber.Subscriber.next (Subscriber.ts:101)
    at MergeMapSubscriber.notifyNext (mergeMap.ts:159)
    at InnerSubscriber._next (InnerSubscriber.ts:17)
    at InnerSubscriber.Subscriber.next (Subscriber.ts:101)
    at CatchSubscriber.Subscriber._next (Subscriber.ts:141)
    at CatchSubscriber.Subscriber.next (Subscriber.ts:101)
    at MergeMapSubscriber.notifyNext (mergeMap.ts:159)
    at InnerSubscriber._next (InnerSubscriber.ts:17)

🌍 Your Environment

Angular Version:




Angular CLI: 7.3.4
Node: 10.15.1
OS: win32 x64
Angular: 7.2.7
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.11.4
@angular-devkit/build-angular     0.11.4
@angular-devkit/build-optimizer   0.11.4
@angular-devkit/build-webpack     0.11.4
@angular-devkit/core              7.1.4
@angular-devkit/schematics        7.3.4
@angular/cli                      7.3.4
@ngtools/webpack                  7.1.4
@schematics/angular               7.3.4
@schematics/update                0.13.4
rxjs                              6.4.0
typescript                        3.1.6
webpack                           4.23.1

Anything else relevant?

@xuemind
Copy link
Author

xuemind commented Mar 7, 2019

by the way, can you update the template of http://stackblitz.com/edit/angular-issue-repro2 to report the issue in a markdown file? It is silly to write report in a html file...😂😭

@ngbot ngbot bot added this to the needsTriage milestone Mar 7, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Apr 4, 2019
martinsik added a commit to martinsik/angular that referenced this issue Apr 11, 2020
martinsik added a commit to martinsik/angular that referenced this issue Apr 13, 2020
martinsik added a commit to martinsik/angular that referenced this issue Apr 18, 2020
…t cause an infinite loop

When loading a module that doesn't provide `RouterModule.forChild()` preloader will get stuck in an infinite loop and throw `ERROR Error: Maximum call stack size exceeded.`
The issue is that child module's `Injector` will look to its parent `Injector` when it doesn't find any `ROUTES` so it will return routes for it's parent module instead. This will load the child again that returns its parent's routes and so on.

Closes angular#29164
martinsik added a commit to martinsik/angular that referenced this issue Apr 18, 2020
…t cause an infinite loop

When loading a module that doesn't provide `RouterModule.forChild()` preloader will get stuck in an infinite loop and throw `ERROR Error: Maximum call stack size exceeded.`
The issue is that child module's `Injector` will look to its parent `Injector` when it doesn't find any `ROUTES` so it will return routes for it's parent module instead. This will load the child again that returns its parent's routes and so on.

Closes angular#29164
martinsik added a commit to martinsik/angular that referenced this issue Apr 18, 2020
…t cause an infinite loop

When loading a module that doesn't provide `RouterModule.forChild()` preloader will get stuck in an infinite loop and throw `ERROR Error: Maximum call stack size exceeded.`
The issue is that child module's `Injector` will look to its parent `Injector` when it doesn't find any `ROUTES` so it will return routes for it's parent module instead. This will load the child again that returns its parent's routes and so on.

Closes angular#29164
@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed severity3: broken labels Oct 1, 2020
martinsik added a commit to martinsik/angular that referenced this issue Jan 13, 2021
…t cause an infinite loop

When loading a module that doesn't provide `RouterModule.forChild()` preloader will get stuck in an infinite loop and throw `ERROR Error: Maximum call stack size exceeded.`
The issue is that child module's `Injector` will look to its parent `Injector` when it doesn't find any `ROUTES` so it will return routes for it's parent module instead. This will load the child again that returns its parent's routes and so on.

Closes angular#29164
martinsik added a commit to martinsik/angular that referenced this issue Jan 13, 2021
…t cause an infinite loop

When loading a module that doesn't provide `RouterModule.forChild()` preloader will get stuck
in an infinite loop and throw `ERROR Error: Maximum call stack size exceeded.`
The issue is that child module's `Injector` will look to its parent `Injector` when it doesn't
find any `ROUTES` so it will return routes for it's parent module instead. This will load the
child again that returns its parent's routes and so on.

Closes angular#29164
martinsik added a commit to martinsik/angular that referenced this issue Jan 14, 2021
…t cause an infinite loop

When loading a module that doesn't provide `RouterModule.forChild()` preloader will get stuck
in an infinite loop and throw `ERROR Error: Maximum call stack size exceeded.`
The issue is that child module's `Injector` will look to its parent `Injector` when it doesn't
find any `ROUTES` so it will return routes for it's parent module instead. This will load the
child again that returns its parent's routes and so on.

Closes angular#29164
AndrewKushnir pushed a commit that referenced this issue Jan 15, 2021
…t cause an infinite loop (#36605)

When loading a module that doesn't provide `RouterModule.forChild()` preloader will get stuck
in an infinite loop and throw `ERROR Error: Maximum call stack size exceeded.`
The issue is that child module's `Injector` will look to its parent `Injector` when it doesn't
find any `ROUTES` so it will return routes for it's parent module instead. This will load the
child again that returns its parent's routes and so on.

Closes #29164

PR Close #36605
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: router freq3: high P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent router: lazy loading state: confirmed type: bug/fix
Projects
None yet
5 participants