Skip to content

$page.url.hash doesn’t update on moving through browser history #10607

@AndreasFaust

Description

@AndreasFaust

Describe the bug

I want my app to react on changes in the URL-hash.
Unfortunately $page.url.hash does not update on routing through browser history.

Reproduction

https://codesandbox.io/p/sandbox/sveltekit-hash-navigation-example-rlxmtv?file=/README.md:3,183

Logs

No response

System Info

System:
    OS: macOS 13.4.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.59 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.0 - /opt/homebrew/bin/node
    Yarn: 1.22.18 - ~/.yarn/bin/yarn
    npm: 9.8.0 - /opt/homebrew/bin/npm
    pnpm: 7.29.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 116.0.5845.96
    Safari: 16.5.2
  npmPackages:
    @sveltejs/adapter-vercel: ^3.0.3 => 3.0.3
    @sveltejs/kit: ^1.23.0 => 1.23.0
    svelte: ^4.2.0 => 4.2.0
    vite: ^4.4.2 => 4.4.9

Severity

serious, but I can work around it

Additional Information

With the SvelteKit next-version it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions