sveltekit and sweetalert2 modals rendered into the body (instead of popup)

I was using sweetalert2 with Svelte a lot, without any problems. But now trying Sveltekit and modals fired by sweetalert2 are actually rendered not as supposed to (as popup), but at the end of body. It has probably something to do with how sveltekit hydrated body with %svelte.body%, but no idea hot to configure etither sveltekit config or sweetalert2 target to make this work. Any help appreciated!


Solution 1:

After some digging in, I found solution myself.

It seems that, unlike regular svelte, sveltekit requires for proper working sweetalert to import .scss file (even if you don't plan to use themes, which it was primarily intended for).

so, adding to component script

import 'sweetalert2/src/sweetalert2.scss'

Actually solved the problem.