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

Regression: Router breaks navigation to custom home URL #3264

Closed
4 tasks done
elringus opened this issue Nov 27, 2023 · 7 comments
Closed
4 tasks done

Regression: Router breaks navigation to custom home URL #3264

elringus opened this issue Nov 27, 2023 · 7 comments
Labels
need more info Further information is requested

Comments

@elringus
Copy link

Describe the bug

When using custom home page and themeConfig.logoLink is set to that paget, after any navigation happens in the docs, clicking the logo loads 404 page. See video below for a demo.

vid.mp4

Reproduction

Not sure how reproduce this in a sandbox (the docs have to be deployed), but here are the sources of the demo above: https://github.com/naninovel/Documentation/tree/master/docs

Notice, that the bug only kicks in after some navigation happens in the docs; eg, it won't reproduce if you open the docs and immediately click the logo (in this case the home page will load correctly).

Expected behavior

Clicking on logo should load custom home page.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 Intel(R) Core(TM) i7-6900K CPU @ 3.20GHz
    Memory: 52.30 GB / 63.92 GB
  Binaries:
    Node: 20.5.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.6.6 - C:\Program Files\nodejs\npm.CMD
    pnpm: 7.29.3 - C:\ProgramData\chocolatey\bin\pnpm.EXE
  Browsers:
    Chrome: 119.0.6045.160
    Edge: Spartan (44.19041.3636.0), Chromium (119.0.2151.72)

Additional context

No response

Validations

@elringus elringus added the bug: pending triage Maybe a bug, waiting for confirmation label Nov 27, 2023
@brc-dd
Copy link
Member

brc-dd commented Nov 29, 2023

This was likely fixed in vitepress 1.0.0-rc.29. Can you try updating your deps.

@brc-dd brc-dd added need more info Further information is requested and removed bug: pending triage Maybe a bug, waiting for confirmation labels Nov 29, 2023
@elringus
Copy link
Author

I've actually tested this on the latest rc.31 (in a branch).

Just to make sure I've updated to 31 on the main branch and deployed — still the same issue.

@zonemeen
Copy link
Collaborator

Try changing the logoLink: "https://naninovel.com" in your configuration to logoLink: "//naninovel.com" or logoLink: "naninovel.com".

@elringus
Copy link
Author

elringus commented Nov 29, 2023

Try changing the logoLink: "https://naninovel.com" in your configuration to logoLink: "//naninovel.com" or logoLink: "naninovel.com".

Didn't work: naniovel.com in logo link redirects to https://naninovel.com/guide/naninovel.com when logo is clicked.

Notice, that I'm using custom ./docs/public/index.html and don't have ./docs/index.md. Previously it worked fine on deployment and in preview, but in dev it was returning 404 (which I didn't mind); I remember in some of the recent patches you've mentioned something about making router both in dev and preview work the same, may this is where it regressed (can't find the exact release to test).

@zonemeen
Copy link
Collaborator

Is it still not working if you set it to logoLink: "//naninovel.com"?

The temporary workaround I can think of is this.🤔

@elringus
Copy link
Author

Is it still not working if you set it to logoLink: "//naninovel.com"?

Nope, still the same behavior.

@brc-dd
Copy link
Member

brc-dd commented Dec 31, 2023

Use this in next version:

    logoLink: {
      link: '/',
      target: '_self'
    },

It should work fine in dev too.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants