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.state not reactive anymore since 2.12.0 #13278

Closed
oversanne opened this issue Jan 6, 2025 · 3 comments
Closed

$page.state not reactive anymore since 2.12.0 #13278

oversanne opened this issue Jan 6, 2025 · 3 comments

Comments

@oversanne
Copy link

Describe the bug

Hello,

Since release 2.12.0, the following code is not reactive anymore with Svelte 4.2, when pressing the button.

Before this release, the number was increasing each time the button is pressed.
After this release, the number increases once to 1, and then is not changing.

In my apps, I have many conditions that are based on the reactiveness of the $page.state (like displaying modals, or panels), and these are not working anymore, and apps can't be used anymore.

Reproduction

<script lang="ts">
	import { pushState } from '$app/navigation';
	import { page } from '$app/stores';

	$: number = $page.state.number ?? 0;
</script>

<div>{number}</div>
<div>{$page.state.number}</div>

<button on:click={() => pushState('', { number: number + 1 })}> Increment </button>

Logs

No response

System Info

System:
    OS: Linux 6.10 Alpine Linux
    CPU: (12) arm64 unknown
    Memory: 5.32 GB / 7.65 GB
    Container: Yes
    Shell: Unknown - /bin/sh
  Binaries:
    Node: 22.12.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.9.0 - /usr/local/bin/npm
  npmPackages:
    @sveltejs/adapter-vercel: 5.5.2 => 5.5.2 
    @sveltejs/kit: ^2.12.0 => 2.12.0 
    @sveltejs/vite-plugin-svelte: ^3.1.2 => 3.1.2 
    svelte: ^4.2.19 => 4.2.19 
    vite: ^5.4.11 => 5.4.11

Severity

blocking all usage of SvelteKit

Additional Information

No response

@paoloricciuti
Copy link
Member

I suspect this was already fixed by #13205 (it needs to be released tho)

@eltigerchino
Copy link
Member

This is fixed by #13205 and will be included in the next release #13277

@oversanne
Copy link
Author

I confirm, 2.15.2 indeed solved the issue.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants