Skip to content
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

@prefresh/vite (@prefresh/core) memory leak bug - "this.forceUpdate on an unmounted component" #475

Closed
antonbarinov opened this issue Oct 9, 2022 · 1 comment · Fixed by #505

Comments

@antonbarinov
Copy link

Fast and easy reproduce on - https://stackblitz.com/edit/vitejs-vite-xwsarc?file=src%2Fapp.tsx&terminal=dev
Steps to reproduce:

  1. Open DevTools console
  2. Click on "counter" button 3 times (need that component <Test /> unmount and then mount again)
  3. edit content of component at line 37, for example:
    return <div>asd</div>; => return <div>asd2</div>;

Result:

Can't call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

Error in replaceComponent function on @prefresh/core

@akbr
Copy link

akbr commented May 30, 2023

This is biting me pretty badly too. I'm getting the can't call ... error 10s or 100s of times per hmr refresh on a larger project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants