Closed ariel-salgado closed 2 days ago
I believe I'm having a similar issue where multiple dom updates in a single frame is throwing this error. I was able to mitigate this by manually requesting the next frame before every mutation but this breaks my logic as I'm doing multiple mutations inside a single yjs transaction.
I think this is likely the same issue as https://github.com/sveltejs/svelte/issues/12280.
This is caused by a combination of hydration and the HMR wrapper, which is why it escaped our tests. Working on it. This is a simple repro, but the bug isn't visible in the preview REPL because there's no HMR/hydration there.
Describe the bug
Although this look like library a related problem, when upgrading svelte 5 from next.170 to next.171 broke the library. It seems very related to this.
Reproduction
The reproduction is very straight forward, when using the next.171 version if you click the button Toast to display a toast and wait until it goes away or dismiss, and click again it works fine, but if you spam the button it just creates one toast and then throws an error which you can see in the dev tools console.
This error doesnt exist in the next.170 version, and spamming the button creates a lot of toasts with no errors.
SvelteLab
I only installed svelte 5 and svelte sonner for the reproduction. So if you want to try it yourself it will work the same.
Logs
System Info
Severity
annoyance