-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Broken hydration after v17 -> v18 migration if i18n blocks are used #56074
Comments
You repro doesn't exibit the issue you are describing. Can you double check ? Did you forgot the |
@zip-fa thanks for providing a repro! As @JeanMeche mentioned, the problem doesn't seem to exist in the code as is, but when I remove
Ideally, when i18n blocks are present, but there is no Looking at the HTML output, this is likely a culprit:
i.e. the cc @devknoll |
More info after some additional investigation: here is a unit test (can be added to the
The fix would likely be somewhere in the |
This is due to the error thrown during hydration |
…t use i18n blocks This commit updates hydration serialization logic to handle a case when the `withI18nSupport()` call is not present for an application that has a component that uses i18n blocks. Note: the issue is only reproducible for components that also inject `ViewContainerRef`, since it triggers a special serialization code path. Resolves angular#56074.
@zip-fa FYI, I've created PR #56175 with the fix for the issue described in #56074 (comment). The PR will go through the regular review and testing phases and will be included into one of the next 18.0.x releases. Thank you. |
…t use i18n blocks (#56175) This commit updates hydration serialization logic to handle a case when the `withI18nSupport()` call is not present for an application that has a component that uses i18n blocks. Note: the issue is only reproducible for components that also inject `ViewContainerRef`, since it triggers a special serialization code path. Resolves #56074. PR Close #56175
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. |
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
Imagine this code:
currentBreakpoint signal can be desktop, mobile or tablet. On server it's always set to 'desktop'.
When i add this little line to my component, hydration breaks and 'desktop' div never cleans up on mobile devices after hydration:
Video:
2024-05-24.21.24.22.mov
Please provide a link to a minimal reproduction of the bug
https://github.com/zip-fa/ng18-broken-hydration
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: