Skip to content

bug: light dom custom element with comment node causes retainer #28189

Closed

Description

@terslada

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When navigating between pages that should not be reused, there are leaks in both nodes and listeners, which makes the application unusable after a while.

Expected Behavior

Pages should be disposed correctly

Steps to Reproduce

Reproducible even inside your ionic conference app example. Simply navigate between schedule and support pages and watch the performance monitor.
Untitled_ Sep 17, 2023 11_13 AM

Code Reproduction URL

https://github.com/ionic-team/ionic-conference-app

Ionic Info

  • ionic info from conference app

Ionic:

Ionic CLI : 6.19.0
Ionic Framework : not installed
@angular-devkit/build-angular : 16.0.0
@angular-devkit/schematics : 16.0.0
@angular/cli : 16.0.0
@ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 4.6.3
@capacitor/android : 4.6.3
@capacitor/core : 4.6.3
@capacitor/ios : 4.6.3

Utility:

cordova-res : 0.15.4
native-run : 1.7.1

System:

NodeJS : v18.16.1 (C:\Program Files\nodejs\node.exe)
npm : 9.7.2
OS : Windows 10

Additional Information

No response

Activity

  1. self-assigned this
    on Sep 18, 2023
  2. liamdebeasi commented on Sep 18, 2023

    @liamdebeasi
    Contributor

    Thanks for the report. I can reproduce this on the latest version of Ionic, but I need to take a closer look to understand why this is happening.

    Is this happening in an app you are building?

  3. added
    needs: reply
    on Sep 18, 2023
  4. terslada commented on Sep 18, 2023

    @terslada
    Author

    Yes, it does.

  5. added and removed
    needs: reply
    on Sep 18, 2023
  6. liamdebeasi commented on Sep 18, 2023

    @liamdebeasi
    Contributor

    Do you have a minimal reproduction of the issue happening in that app?

  7. added
    needs: reply
    on Sep 18, 2023
  8. terslada commented on Sep 18, 2023

    @terslada
    Author

    It is a production application that I can not really share, but It happens consistently every time I close a page that should be destroyed. Same as in the example app.

  9. added and removed
    needs: reply
    on Sep 18, 2023
  10. liamdebeasi commented on Sep 18, 2023

    @liamdebeasi
    Contributor

    Any minimal reproduction you can provide will make it easier for us to diagnose and potentially fix the issue. Otherwise, I'll keep working through the conference app. However, it is a big app so it will likely delay any results.

  11. 41 remaining items

  12. terslada commented on Dec 8, 2023

    @terslada
    Author

    Great, I got rid of the footer because of this. looking forward to a fix.
    Thanks

  13. terslada commented on Feb 6, 2024

    @terslada
    Author

    Any news on this?

  14. liamdebeasi commented on Feb 6, 2024

    @liamdebeasi
    Contributor

    Can you give this a try in Ionic 7.7.0? The underlying Stencil bug should have been resolved in Stencil 4.11.0.

  15. terslada commented on Feb 6, 2024

    @terslada
    Author

    Sadly still behaves the same way

  16. liamdebeasi commented on Feb 6, 2024

    @liamdebeasi
    Contributor

    Thanks for testing. I spoke with the Stencil team, and it sounds like there may be multiple bugs in Stencil that need resolving. I'll work with them to see if we can find a good resolution here.

  17. terslada commented on Feb 16, 2024

    @terslada
    Author

    Lately I look a bit into the memory leaks again. There are leaks everywhere caused by using ionic components. I dont rly know what to do, because the application gets unusable after a while. It is ment to be running for many hours, but now it has to be restarted often to be usable.

    image
    image

  18. aeharding commented on Feb 29, 2024

    @aeharding
    Contributor

    Thanks for testing. I spoke with the Stencil team, and it sounds like there may be multiple bugs in Stencil that need resolving. I'll work with them to see if we can find a good resolution here.

    @liamdebeasi, are there Github issues for these Stencil bugs?

  19. liamdebeasi commented on Feb 29, 2024

    @liamdebeasi
    Contributor

    The issues that are potentially related are stenciljs/core#5181 and stenciljs/core#5172. The Stencil team is still investigating these issues.

  20. christian-bromann commented on Jan 10, 2025

    @christian-bromann
    Contributor

    @terslada @aeharding we have just published a fix for this in Stencil and will continue to work with the Ionic team to get this updated in Ionic Framework as well.

  21. added a commit that references this issue on Jan 27, 2025
  22. ionitron-bot commented on Jan 10, 2026

    @ionitron-bot

    Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

    Thank you for using Ionic!

  23. locked and limited conversation to collaborators on Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: externalionitron: stale issue

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions