Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

bug(MatTooltip): Tooltips not working in 19.1.4 on ssr page: TypeError: t is not iterable #30498

Closed
1 task done
amazing4u opened this issue Feb 16, 2025 · 0 comments · Fixed by #30500
Closed
1 task done
Assignees
Labels
area: material/tooltip P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@amazing4u
Copy link

amazing4u commented Feb 16, 2025

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

19.1.3

Description

In Version 19.1.4 of @angular/material the tooltips stopped working on all elements (buttons, div etc.) when i load the server side rendered page.
Maybe a problem with hydration of the MatTooltip!?

if i navigate in the app to another component and back then it works again.

I get this stack trace error:

TypeError: t is not iterable
    at Ew (core.mjs:16364:32)
    at Uw (core.mjs:17954:42)
    at zw (core.mjs:17969:8)
    at Fh (core.mjs:17871:3)
    at Bw (core.mjs:17644:10)
    at Yf (core.mjs:5158:17)
    at Zf (core.mjs:5120:19)
    at Ft.get (core.mjs:5405:12)
    at i.show (tooltip.mjs:291:97)
    at HTMLButtonElement.<anonymous> (tooltip.mjs:575:16)

Reproduction

I could not provide a working StackBlitz example. I think it is because of the server side rendering + hydration.

Expected Behavior

MatToolTip should be shown. It worked in Version 19.1.3

Actual Behavior

Error. MatToolTip is not shown

Environment

  • Angular: 19.1.6
  • CDK/Material: 19.1.4
  • Browser(s): Edge, Chrome
  • Operating System: Windows
@amazing4u amazing4u added the needs triage This issue needs to be triaged by the team label Feb 16, 2025
@amazing4u amazing4u changed the title bug(MatTooltip): Tooltips not working in 19.1.4: TypeError: t is not iterable bug(MatTooltip): Tooltips not working in 19.1.4 on ssr page: TypeError: t is not iterable Feb 16, 2025
@crisbeto crisbeto self-assigned this Feb 17, 2025
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/tooltip and removed needs triage This issue needs to be triaged by the team labels Feb 17, 2025
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 17, 2025
angular#30440 deferred the injection of some dependencies in the tooltip, including `ViewContainerRef`. This is problematic, because the act of injecting `ViewContainerRef` changes the shape of some internal data structures in the framework's runtime. As a result, hovering over a tooltip that has been hydrated will throw a runtime error because the structure from the server no longer matches the structure on the client.

Fixes angular#30498.
crisbeto added a commit that referenced this issue Feb 18, 2025
…0500)

#30440 deferred the injection of some dependencies in the tooltip, including `ViewContainerRef`. This is problematic, because the act of injecting `ViewContainerRef` changes the shape of some internal data structures in the framework's runtime. As a result, hovering over a tooltip that has been hydrated will throw a runtime error because the structure from the server no longer matches the structure on the client.

Fixes #30498.

(cherry picked from commit 68b267d)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: material/tooltip P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants