Thursday | 21 NOV 2024
[ previous ]
[ next ]

Sveltekit Gotchas

Title:
Date: 2023-04-19
Tags:  

A list of sveltekit gotchas, I'm going to tag the date as well as sveltekit seems to still be moving too much to be considered stable even at 1.0.


2023-04-19

To load an external script into a sveltekit project, you need to add the script via javascript injection and then run your code once the script loads.

https://github.com/sveltejs/kit/issues/9096


2023-04-19

$page.url should be considered read only. Duplicate it in a new variable and then use goto with that new variable to get the correct behavior. The key issue is that updating $page.url.searchParams doesn't result in the load function being executed correctly.

https://github.com/sveltejs/kit/issues/9510