Skip to content

Preloading mounts incorrect page #14946

@dangodai

Description

@dangodai

Describe the bug

Preloading causes the wrong page to be mounted if you preload a page and then click a link to the page you are already on.

Reproduction

REPL: https://www.sveltelab.dev/6wio069s34y6vm7?files=.%2Fsrc%2Froutes%2F%2Blayout.svelte

  1. When you are on /, hover the link to page 2 to preload it.
  2. Click the link for page 1 (/) and observe that page 2 gets mounted, despite the route not changing

Logs

System Info

System:
    OS: Linux 6.17 Arch Linux
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 5.65 GB / 15.54 GB
    Container: Yes
    Shell: 5.3.3 - /bin/bash
  Binaries:
    Node: 22.17.0 - /home/yung/.nvm/versions/node/v22.17.0/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.9.2 - /home/yung/.nvm/versions/node/v22.17.0/bin/npm
    pnpm: 10.13.1 - /home/yung/.local/share/pnpm/pnpm
  Browsers:
    Chromium: 142.0.7444.134
    Firefox: 144.0.2
    Firefox Developer Edition: 144.0.2
  npmPackages:
    @sveltejs/adapter-auto: ^7.0.0 => 7.0.0 
    @sveltejs/kit: ^2.48.5 => 2.48.5 
    @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1 
    svelte: ^5.43.6 => 5.43.6 
    vite: ^7.1.10 => 7.1.12

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions