Skip to content

Anchor links broken when navigating across pages #2664

Description

@mikenikles

Describe the bug

I upgraded to next.188 yesterday and notice anchor links no longer work across pages.

Steps to reproduce

  1. Navigate to https://deploy-preview-1131--gitpod-kumquat.netlify.app/blog
  2. Click "Sign up" at the top right

Actual result
The homepage loads, scrolled to the top

Expected result
The homepage loads, scrolled down to the Get Started Now section.

Note, if you click "Sign Up" again after step 2 (i.e. when you're on the homepage), the anchor link works.

Has anyone else seen this? I've been looking through Discord and GitHub, not much luck so far but will continue to search.

Reproduction

  1. npm init svelte@next & follow the instructions
  2. In src/routes/index.html add a bunch of <br /> elements to make the page scrollable, then add <h1 id="jump-here">Here is a page anchor</h1> at the bottom of the page
  3. In src/routes/about.html add a link: <a href="/#jump-here">Jump to section on homepage</a>

Logs

No response

System Info

System:
    OS: macOS 11.2.3
    CPU: (8) x64 Apple M1
    Memory: 136.04 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.4 - /usr/local/bin/node
    npm: 7.7.6 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 94.1.30.87
    Chrome: 95.0.4638.54
    Edge: 93.0.961.47
    Firefox: 92.0
    Firefox Developer Edition: 88.0
    Safari: 14.0.3
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.188 
    svelte: ^3.34.0 => 3.44.0

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.router

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions