Closed Enteleform closed 4 months ago
it's expected. HMR is usually fast enough to reload before that 1s timeout can even run.
Would it be possible to add an option for solid-refresh
that waits for onCleanup
to finish before respawning components?
And are there any recommended workarounds/patterns for avoiding this issue?
No, because even Solid doesn't manage async lifecycle callbacks. You'll have to manage this on your own.
Gotcha, thanks for the info 👍
I ran into an issue with a third-party library that has a registration/unregistration process which is causing errors during HMR due to an unexpected order of events.
To prevent this error, the following event order would be required:
But this is what's actually occurring:
Here's a minimal repro: https://stackblitz.com/edit/solid-vite-lynwpq?file=src%2Findex.tsx