sveltejs / kit

web development, streamlined
https://svelte.dev/docs/kit
MIT License
18.68k stars 1.93k forks source link

clicking link while onNavigate is pending toggles the URL #12809

Open stephanedemotte opened 2 weeks ago

stephanedemotte commented 2 weeks ago

Describe the bug

Hello,

I've a weird issue, when i return promise on onNavigation, until the promise was resolve, if i "re-click" on the same link, the url "toggle"

Here a video

https://github.com/user-attachments/assets/efbf3657-e62e-4d50-b59f-f5ca78415dc2

Reproduction

https://github.com/stephanedemotte/svelte-routing-bug

Logs

No response

System Info

System:
    OS: macOS 14.6.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 562.87 MB / 16.00 GB
    Shell: 3.1.2 - /usr/local/bin/fish
  Binaries:
    Node: 22.6.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 9.7.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 129.0.6668.100
    Safari: 18.0.1
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.2.5
    @sveltejs/kit: ^2.0.0 => 2.7.0
    @sveltejs/vite-plugin-svelte: ^4.0.0-next.6 => 4.0.0-next.8
    svelte: ^5.0.0-next.1 => 5.0.0-next.264
    vite: ^5.0.3 => 5.4.9

Severity

blocking an upgrade

Additional Information

No response

eltigerchino commented 2 weeks ago

I've tested this and it happens on Svelte 4 too