Skip to content

svelte:head updates prematurely in async mode #17114

@agillispie

Description

@agillispie

Describe the bug

I have a page where you can contact other users. The route is /contact/[id] the +page.server.ts file for that page retrieves the user information you are trying to contact from the DB and returns it via load. Then the svelte head is set on that page to display a title of Contact <name> and also displays the info of the person you are contacting. The links to reach these pages are just simple anchor tags.

The issue I am facing is that just hovering over the anchor tag the data is preloaded and updates the page title and any other head content before clicking on the anchor. Also, clicking on the anchor tag ends up causing the app to crash or freeze. Once you reload the page, the previous clicks are added into the window history.

Reproduction

Github Repo

Logs

no logs are displayed

System Info

System:
    OS: macOS 26.0
    CPU: (10) arm64 Apple M4
    Memory: 137.41 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.1 - /Users/agill/.nvm/versions/node/v22.13.1/bin/node
    npm: 11.2.0 - /Users/agill/.nvm/versions/node/v22.13.1/bin/npm
    pnpm: 10.20.0 - /Users/agill/.nvm/versions/node/v22.13.1/bin/pnpm
    bun: 1.2.21 - /Users/agill/.bun/bin/bun
  Browsers:
    Chrome: 142.0.7444.60
    Safari: 26.0
  npmPackages:
    @sveltejs/adapter-auto: ^7.0.0 => 7.0.0 
    @sveltejs/kit: ^2.47.1 => 2.48.4 
    @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1 
    svelte: ^5.41.0 => 5.43.3 
    vite: ^7.1.10 => 7.1.12

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions