Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$page store does not react to certain navigation changes or stores incorrect data #12742

Closed
gyzerok opened this issue Oct 2, 2024 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@gyzerok
Copy link

gyzerok commented Oct 2, 2024

Describe the bug

I've found two bugs with navigating using both goto and pushState 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:

  1. Go to page /bug
  2. Click goto button
  3. No effects run and console log anything (expected console log about state change)
  4. Click Log $page button and see that actually state in the $page changed

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:

  1. Go to page /bug
  2. Click on pushState button
  3. You get a log where params.id: "bug", however in the browser url you see /test

Logs

No response

System Info

@sveltejs/kit: 2.6.1
svelte: 5.0.0-next.260

Severity

serious, but I can work around it

Additional Information

No response

@gyzerok gyzerok changed the title Page store does not react to certain navigation changes or stores incorrect data $page store does not react to certain navigation changes or stores incorrect data Oct 2, 2024
@eltigerchino eltigerchino added the bug Something isn't working label Oct 18, 2024
@eltigerchino
Copy link
Member

eltigerchino commented Oct 18, 2024

also related to #11503 where the page store is not being notified of updates made to it

@eltigerchino eltigerchino added this to the soon milestone Oct 18, 2024
@gyzerok
Copy link
Author

gyzerok commented Dec 22, 2024

@eltigerchino it looks like the first part of this bug is fixed with #13196, however the second one is still in place.

I've updated my repo with the latest version of svelte and sveltekit.

@eltigerchino
Copy link
Member

eltigerchino commented Dec 23, 2024

closing as duplicate of #13200 . I've tested and this is fixed by #13205 . You can also test this with the PR's changes by running

npm add https://pkg.pr.new/sveltejs/kit/@sveltejs/kit@13205

@eltigerchino eltigerchino closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants