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

afterNavigate callbacks do not get removed when returning a function in onNavigate #13240

Open
Elia872 opened this issue Dec 25, 2024 · 0 comments · May be fixed by #13241
Open

afterNavigate callbacks do not get removed when returning a function in onNavigate #13240

Elia872 opened this issue Dec 25, 2024 · 0 comments · May be fixed by #13241
Labels
bug Something isn't working

Comments

@Elia872
Copy link
Contributor

Elia872 commented Dec 25, 2024

Describe the bug

When returning a function from an onNavigate callback in a parent layout, a child afterNavigate does not get removed during a page change.

Reproduction

https://github.com/Elia872/kit-afternav-error

navigate by clicking links back and forth from /a and /b, and see how in the console each time the number of logs increases. Also see the "after navigate was called" in /b, it should be false, but the code in /a's afterNavigate changes it to true.

Logs

No response

System Info

System:
    OS: Linux 6.8 Linux Mint 22 (Wilma)
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 19.20 GB / 31.23 GB
    Container: Yes
    Shell: 3.7.1 - /usr/bin/fish
  Binaries:
    Node: 20.16.0 - ~/.local/share/pnpm/node
    npm: 10.8.1 - ~/.local/share/pnpm/npm
    pnpm: 9.15.1 - ~/.local/share/pnpm/pnpm
    bun: 1.1.18 - ~/.bun/bin/bun
    Watchman: 4.9.0 - /usr/bin/watchman
  Browsers:
    Chrome: 131.0.6778.139
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.3.1
    @sveltejs/kit: ^2.0.0 => 2.15.0
    @sveltejs/vite-plugin-svelte: ^4.0.0 => 4.0.4
    svelte: ^5.0.0 => 5.16.0
    vite: ^5.4.11 => 5.4.11

Severity

serious, but I can work around it

Additional Information

No response

@eltigerchino eltigerchino added the bug Something isn't working label Dec 26, 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

Successfully merging a pull request may close this issue.

2 participants