The Wayback Machine - https://web.archive.org/web/20250418135906/https://github.com/vuejs/vue/issues/11760
Skip to content

Memory leaking components on asynchronous return calls after destruction #11760

Closed
@badpunman

Description

@badpunman

Version

2.6.11

Reproduction link

https://github.com/badpunman/vuememoryleak

Steps to reproduce

Clone repository
npm install
npm run serve
open localhost:8080
Open chrome memory tab or other tool for analysis
Click button multiple times.

What is expected?

Vue should release components and the memory.

What is actually happening?

Components are not released.


Continuation to #11755 which was closed with too much haste.

Now demonstrated with $nextTick so we dont have any nasty arguments about whether or not it's due to not cleaning up asynchronous HTTP calls or setTimeouts. $nextTick does not provide a cancellation method so either it's broken in this regard or this is a valid issue.

Vue should not depend its watchers on component if it has already been destroyed.

If this is still not a valid bug, all vue's documentation needs an overhaul as it encourages to write code in a way that allows for memory leaks. $nextTick should then also be removed from codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions