Skip to content

Async mode prevents afterNavigate from running at mount #14618

@bleucitron

Description

@bleucitron

Describe the bug

afterNavigate will not run on mount if async is on.

It should be noted that client navigations will result in afterNavigate running. The issue is only during mounting.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-pssb4ubb?file=svelte.config.js

Logs

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^6.0.0 => 6.1.1 
    @sveltejs/kit: ^2.44.0 => 2.44.0 
    @sveltejs/vite-plugin-svelte: ^6.0.0 => 6.2.1 
    svelte: ^5.39.9 => 5.39.9 
    vite: ^7.0.4 => 7.1.9

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsvelte 5

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions