Open gyzerok opened 2 weeks ago
I've found two bugs with navigating using both goto and pushState related to $page store.
goto
pushState
$page
When navigating with goto to the same route as the current one even though $page.state changes no $effect runs on it.
$page.state
$effect
When using pushState and passing new url to it you get stuck with $page.params pointing to the previous incorrect url.
$page.params
Here is the repo: https://github.com/gyzerok/sveltekit-nav-bug
Bug with goto and state:
/bug
Log $page
With Svelte I strongly expect that if some state changes the effects are run as a result of this change which is not the case here.
Bug with pushState and url:
params.id: "bug"
/test
No response
@sveltejs/kit: 2.6.1 svelte: 5.0.0-next.260
serious, but I can work around it
also related to https://github.com/sveltejs/kit/issues/11503 where the page store is not being notified of updates made to it
Describe the bug
I've found two bugs with navigating using both
goto
andpushState
related to$page
store.When navigating with
goto
to the same route as the current one even though$page.state
changes no$effect
runs on it.When using
pushState
and passing new url to it you get stuck with$page.params
pointing to the previous incorrect url.Reproduction
Here is the repo: https://github.com/gyzerok/sveltekit-nav-bug
Bug with
goto
and state:/bug
goto
buttonLog $page
button and see that actually state in the $page changedWith Svelte I strongly expect that if some state changes the effects are run as a result of this change which is not the case here.
Bug with
pushState
and url:/bug
pushState
buttonparams.id: "bug"
, however in the browser url you see/test
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response