Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect not getting executed when coming from an anchor (regression from latest routes refactor) #6292

Closed
pablote opened this issue Aug 25, 2022 · 1 comment

Comments

@pablote
Copy link

pablote commented Aug 25, 2022

Describe the bug

This used to work before the recent routing refactor.

My app has a redirect to the main app section on the top level load function, now +page.js. So that anyone navigating to the root would get redirected to the first/main section.

This used to work fine on pretty much every scenario, but now it's failing whenever a user clicks on a link/anchor with href="/" which used to redirect fine.

Reproduction

Issue is reproducible here: https://github.com/pablote/repro-href-redirect

  • Go to the root
  • You'll get redirected to /main
  • Click on the site title to navigate to /

Expected: User should get redirected again to /main
Actual: error

Logs

No response

System Info

System:
    OS: macOS 12.5.1
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 71.40 MB / 16.00 GB
    Shell: 5.9 - /usr/local/bin/zsh
  Binaries:
    Node: 16.15.1 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 8.15.0 - /usr/local/bin/npm
    Watchman: 2022.08.15.00 - /usr/local/bin/watchman
  Browsers:
    Brave Browser: 103.1.41.96
    Chrome: 104.0.5112.101
    Firefox Developer Edition: 105.0
    Safari: 15.6.1
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.66 
    @sveltejs/kit: next => 1.0.0-next.440 
    svelte: ^3.44.0 => 3.49.0 
    vite: ^3.0.4 => 3.0.9

Severity

blocking an upgrade

Additional Information

No response

@Rich-Harris
Copy link
Member

Closing as duplicate: #5952

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants