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

[Bug report] Incorrect base in plugin-docsearch #227

Closed
SherkeyXD opened this issue Jul 26, 2024 · 5 comments
Closed

[Bug report] Incorrect base in plugin-docsearch #227

SherkeyXD opened this issue Jul 26, 2024 · 5 comments

Comments

@SherkeyXD
Copy link

SherkeyXD commented Jul 26, 2024

Description

When the base is not the root, like /docs, something weird is happening.
Left click the search result, you got the right base, like /docs.
However, if you press enter, the base is repeated twice, like /docs/docs.

I think this maybe be related to 7e56412, where two different bases appear.

resolveRoutePathFromUrl(item.url, __DOCSEARCH_INDEX_BASE__),

router.push(hit.url.replace(__VUEPRESS_BASE__, '/'))

One is __DOCSEARCH_INDEX_BASE__, and the other is __VUEPRESS_BASE__.

Reproduction

https://github.com/MaaAssistantArknights/MaaAssistantArknights/tree/dev/docs

Used Package Manager

pnpm

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 1.35 GB / 15.63 GB
  Binaries:
    Node: 20.9.0 - ~\AppData\Local\fnm_multishells\21264_1722010991173\node.EXE
    Yarn: Not Found
    npm: 10.8.2 - ~\AppData\Local\fnm_multishells\21264_1722010991173\npm.CMD
    pnpm: 9.1.4 - ~\AppData\Local\fnm_multishells\21264_1722010991173\pnpm.CMD
    bun: Not Found
  Utilities:
    Git: 2.45.1.
  Browsers:
    Chrome: Not Found
    Edge: Chromium (126.0.2592.113)
  npmPackages:
    @vuepress/bundler-vite: 2.0.0-rc.14 => 2.0.0-rc.14
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli: Not Found
    @vuepress/client: Not Found
    @vuepress/core: Not Found
    @vuepress/markdown: Not Found
    @vuepress/shared: Not Found
    @vuepress/utils: Not Found
    vue: ^3.4.33 => 3.4.33
    vue-router: Not Found
    vuepress: 2.0.0-rc.14 => 2.0.0-rc.14
@SherkeyXD SherkeyXD changed the title [Bug report] [Bug report] Incorrect base in plugin-docsearch Jul 26, 2024
@Mister-Hope Mister-Hope closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
@Mister-Hope
Copy link
Member

I think this is a basic that you should use the latest v2 before opening any issues.

@Mister-Hope Mister-Hope added the invalid This doesn't seem right label Jul 26, 2024
Copy link

Hello @SherkeyXD. This issue is marked as invalid and closed. Please follow the issue template.

@SherkeyXD
Copy link
Author

SherkeyXD commented Jul 26, 2024

I've already tested locally with the newest version when writing this issue, and the problem still exists.
Here are the dependencies in my local machine.

"devDependencies": {
    "@vuepress/bundler-vite": "2.0.0-rc.14",
    "@vuepress/plugin-docsearch": "2.0.0-rc.40",
    "@vuepress/plugin-google-analytics": "2.0.0-rc.37",
    "@vuepress/plugin-shiki": "^2.0.0-rc.40",
    "markdown-it": "^14.1.0",
    "markdown-it-anchor": "^9.0.1",
    "vue": "^3.4.33",
    "vuepress": "2.0.0-rc.14",
    "vuepress-theme-hope": "2.0.0-rc.52"
},

And the commit 7e56412 first appears in v2.0.0-rc.39, which is just the deployed version.

@SherkeyXD
Copy link
Author

SherkeyXD commented Jul 26, 2024

The problem is that the MouseEvent event and keydown event result in different base paths.
In v2.0.0-rc.38 they are the same.

Edit: the href is correct, so the problem should be the keydown event.

@Mister-Hope Mister-Hope reopened this Jul 26, 2024
@Mister-Hope Mister-Hope removed the invalid This doesn't seem right label Jul 26, 2024
@Mister-Hope
Copy link
Member

Then you should provide a reproducion

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