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

*ngrxLet causes ASSERTION ERROR: Reached the max number of directives [Expected=> 1 != 1 <=Actual] #3246

Closed
e-davidson opened this issue Nov 19, 2021 · 1 comment · Fixed by #3255

Comments

@e-davidson
Copy link
Contributor

The issue seems to be when the observable emits while angular is still constructing the template.

Minimal reproduction of the bug/regression with instructions:

Here's an example to reproduce

https://github.com/e-davidson/angular-issue-reproduction-2021

Expected behavior:

The component should render with no errors.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

NgRx 13, Angular 13, Node 14.17, OS wsl, browser chrome

Other information:

I also submitted an issue to the angular team
angular/angular#44231

If they do fix the issue this would still be a problem since createEmbeddedView will have been called an extra time when it shouldn't due to the recurssion.

I believe it can be easily fixed by not relying on the embeddedView to be null and instead have a field if it's the first time or not.

See here
https://github.com/ngrx/platform/blob/master/modules/component/src/let/let.directive.ts#L121

I would be willing to submit a PR to fix this issue

Sure, I'd love to help if the team feels this is correct.

[x ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

@markostanimirovic
Copy link
Member

Good catch @e-davidson ! 👍 The proposed solution seems good to me.

e-davidson added a commit to e-davidson/platform that referenced this issue Nov 28, 2021
handles edge case where rendering causes the observable to emit which causes
`ASSERTION ERROR: Reached the max number of directives [Expected=> 1 != 1 <=Actual]`

Closes issue ngrx#3246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants