You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for additional information. The <router-outlet> under the hood also uses view container APIs to create a component for a route, so this may have the same root cause. I was able to reproduce the problem locally and the issue happens when a view container is projected from a hydrated component to a component that skips hydration (and re-creates all nodes). I'll work on a fix and share an update when I have it.
Meanwhile, could you please try wrapping the <router-outlet> into an extra element to see if that resolves the issue? For example:
@robertIsaac I've created a draft version of a fix for this issue, could you please try to test the behavior of your application with this fix applied?
You can update the package.json file locally and replace the @angular/core dependency with the following package:
@robertIsaac thanks for the update. The fix was applied to the Embedded Views code path only, but not the Component path. I've added the necessary changes and you can test the behavior using the following package:
I've tested this package with the repro and hydration works correctly there now. Could you please try to test the fix in your real application as well and let us know if it resolved the issue?
Just wanted to share a quick update: Angular v16.0.1 was released today. Angular v16.0.1 includes the fix for this issue, please try updating to v16.0.1 and let us know if he problem still exists. Thank you.
Just wanted to share a quick update: Angular v16.0.1 was released today. Angular v16.0.1 includes the fix for this issue, please try updating to v16.0.1 and let us know if he problem still exists. Thank you.
thank you for your update and quick fix
I confirm the reprod works fine, but for my application I can't verify it for now, if when I test it found the problem still existing I add a new comment here
Activity
AndrewKushnir commentedon May 6, 2023
@robertIsaac thanks for reporting the problem and sharing a repro, the repro is very helpful 👍
I noticed is that the problem happens when there is a view container (
*ngFor) in use:when there is no view container as a root node, content projection works fine.
As a temporary solution, you could try wrapping projected content into an element like this:
We'll perform further investigation and will keep this thread updated.
Thank you.
robertIsaac commentedon May 6, 2023
Well in the real case there is no ngfor and it doesn't work, but it's complicated one
FYI using router-outlet also make it not working
AndrewKushnir commentedon May 7, 2023
Thanks for additional information. The
<router-outlet>under the hood also uses view container APIs to create a component for a route, so this may have the same root cause. I was able to reproduce the problem locally and the issue happens when a view container is projected from a hydrated component to a component that skips hydration (and re-creates all nodes). I'll work on a fix and share an update when I have it.Meanwhile, could you please try wrapping the
<router-outlet>into an extra element to see if that resolves the issue? For example:Thank you.
AndrewKushnir commentedon May 8, 2023
@robertIsaac I've created a draft version of a fix for this issue, could you please try to test the behavior of your application with this fix applied?
You can update the
package.jsonfile locally and replace the@angular/coredependency with the following package:After that you can run
npm install --forceand test the behavior of the app once again.Please let us know if that resolved the issue.
Thank you.
3 remaining items
AndrewKushnir commentedon May 9, 2023
@robertIsaac thanks for the update. The fix was applied to the Embedded Views code path only, but not the Component path. I've added the necessary changes and you can test the behavior using the following package:
I've tested this package with the repro and hydration works correctly there now. Could you please try to test the fix in your real application as well and let us know if it resolved the issue?
Thank you.
fix(core): handle projection of hydrated containters into components …
fix(core): handle projection of hydrated containters into components …
AndrewKushnir commentedon May 10, 2023
Just wanted to share a quick update: Angular v16.0.1 was released today. Angular v16.0.1 includes the fix for this issue, please try updating to v16.0.1 and let us know if he problem still exists. Thank you.
robertIsaac commentedon May 10, 2023
thank you for your update and quick fix
I confirm the reprod works fine, but for my application I can't verify it for now, if when I test it found the problem still existing I add a new comment here
docs: added clarity in lifecycle event docs (#50145)
docs: added clarity in lifecycle event docs (#50145)
angular-automatic-lock-bot commentedon Jun 10, 2023
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.