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
import.meta.hot.dispose not working? #53
Comments
Are there any news? Looks like a very major blocker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems disposing of side effects does not work. If I have some background task running (job scheduler, db watcher, etc.) in my server, I usually gracefully clean it up on shutdown by listening for signals.
In order for this to work in HMR, my understanding is that I need to register a dispose callback in the file with the side effect. E.g.:
However, the callback is never called, so I'll have two intervals printing pings.
Reproduction:
https://stackblitz.com/edit/node-qfyzmw?file=index.ts,fileWithSideEffect.ts
Change e.g. 'ping' -> 'ping1'
Reload right side
The text was updated successfully, but these errors were encountered: