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

invalidating layout load function on mount makes it so that layout load function reruns on any preload until clicked #10457

Closed
nasheomirro opened this issue Jul 31, 2023 · 1 comment

Comments

@nasheomirro
Copy link

Describe the bug

When using invalidate() inside an onMount(), the layout load function that was invalidated now runs every time sveltekit preloads pages. In the reproduction link below every time I hover on a pre-loadable link it will also run the layout load function. Once we click a link though the bug seemingly disappears.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-7tjszr?file=src%2Froutes%2F%2Blayout.svelte

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
    Memory: 1.91 GB / 3.51 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
    npm: 9.7.2 - ~/.nvm/versions/node/v18.16.1/bin/npm
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0 
    @sveltejs/kit: ^1.20.4 => 1.22.3 
    svelte: ^4.0.5 => 4.1.1 
    vite: ^4.4.2 => 4.4.7

Severity

annoyance

Additional Information

No response

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

2 participants