-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
Description
Describe the bug
main-server.js
re-exports onDestroy
from main-client.js
. This is wrong. That function looks like this:
export function onDestroy(fn) {
if (!is_ssr) {
user_effect(() => () => untrack(fn));
}
}
Instead, we should export a server-side onDestroy
directly from main-server.js
, and it should run destroy callbacks once SSR is complete.
I also noticed that we're re-exporting createEventDispatcher
, when that should (I think?) just be a no-op in SSR like onMount
and friends.
Reproduction
In lieu of a repro I'll open a PR with a failing test
Logs
No response
System Info
next
Severity
annoyance