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
Hostbinding fails when there are several thousand context matches #37876
Labels
area: core
Issues related to the framework runtime
regression
Indicates than the issue relates to something that worked in a previous version
state: confirmed
state: has PR
type: bug/fix
Milestone
Comments
atscott
added
area: core
Issues related to the framework runtime
router: directives
RouterLink, RouterLinkActive, RouterOutlet etc.
regression
Indicates than the issue relates to something that worked in a previous version
engine: ivy
state: confirmed
and removed
area: router
router: directives
RouterLink, RouterLinkActive, RouterOutlet etc.
labels
Jul 6, 2020
atscott
changed the title
"ERROR TypeError: Cannot read property 'href' of undefined" on a page with many routerLinks
Hostbinding fails when there are several thousand context matches
Jul 6, 2020
reproduction without the router: https://github.com/atscott/manyhostbindings (note that I created my own |
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Jul 11, 2020
… bindings We currently use 16 bits to store information about nodes in a view. The 16 bits give us 65536 entries in the array, but the problem is that while the number is large, it can be reached by ~4300 directive instances with host bindings which could realistically happen is a very large view, as seen in angular#37876. Once we hit the limit, we end up overflowing which eventually leads to a runtime error. These changes bump to using 20 bits which gives us around 1048576 entries in the array or 16 times more than the current amount which could still technically be reached, but is much less likely and the user may start hitting browser limitations by that point. I picked the 20 bit number since it gives us enough buffer over the 16 bit one, while not being as massive as a 24 bit or 32 bit. I've also added a dev mode assertion so it's easier to track down if it happens again in the future. Fixes angular#37876.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Jul 11, 2020
… bindings We currently use 16 bits to store information about nodes in a view. The 16 bits give us 65536 entries in the array, but the problem is that while the number is large, it can be reached by ~4300 directive instances with host bindings which could realistically happen is a very large view, as seen in angular#37876. Once we hit the limit, we end up overflowing which eventually leads to a runtime error. These changes bump to using 20 bits which gives us around 1048576 entries in the array or 16 times more than the current amount which could still technically be reached, but is much less likely and the user may start hitting browser limitations by that point. I picked the 20 bit number since it gives us enough buffer over the 16 bit one, while not being as massive as a 24 bit or 32 bit. I've also added a dev mode assertion so it's easier to track down if it happens again in the future. Fixes angular#37876.
AndrewKushnir
pushed a commit
that referenced
this issue
Jul 17, 2020
… bindings (#38014) We currently use 16 bits to store information about nodes in a view. The 16 bits give us 65536 entries in the array, but the problem is that while the number is large, it can be reached by ~4300 directive instances with host bindings which could realistically happen is a very large view, as seen in #37876. Once we hit the limit, we end up overflowing which eventually leads to a runtime error. These changes bump to using 20 bits which gives us around 1048576 entries in the array or 16 times more than the current amount which could still technically be reached, but is much less likely and the user may start hitting browser limitations by that point. I picked the 20 bit number since it gives us enough buffer over the 16 bit one, while not being as massive as a 24 bit or 32 bit. I've also added a dev mode assertion so it's easier to track down if it happens again in the future. Fixes #37876. PR Close #38014
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. |
profanis
pushed a commit
to profanis/angular
that referenced
this issue
Sep 5, 2020
… bindings (angular#38014) We currently use 16 bits to store information about nodes in a view. The 16 bits give us 65536 entries in the array, but the problem is that while the number is large, it can be reached by ~4300 directive instances with host bindings which could realistically happen is a very large view, as seen in angular#37876. Once we hit the limit, we end up overflowing which eventually leads to a runtime error. These changes bump to using 20 bits which gives us around 1048576 entries in the array or 16 times more than the current amount which could still technically be reached, but is much less likely and the user may start hitting browser limitations by that point. I picked the 20 bit number since it gives us enough buffer over the 16 bit one, while not being as massive as a 24 bit or 32 bit. I've also added a dev mode assertion so it's easier to track down if it happens again in the future. Fixes angular#37876. PR Close angular#38014
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: core
Issues related to the framework runtime
regression
Indicates than the issue relates to something that worked in a previous version
state: confirmed
state: has PR
type: bug/fix
🐞 bug report
Affected Package
The issue is caused by package @angular/routerIs this a regression?
Yes, the previous version in which this bug was not present was: 8.2.14Description
On a page with a large number of [routerLink] directives the following Error is thrown. The number of router links appears to be somewhere > 3000.
🔬 Minimal Reproduction
https://stackblitz.com/...A repro repo can be found here: https://github.com/langfors/manyRouterlinks
🔥 Exception or Error
🌍 Your Environment
Angular Version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: