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

CleanUrls with with-subfolders/without-subfolders fails lookup from __VP_HASH_MAP__ upon trailing slash #1442

Closed
3 tasks done
pkkummermo opened this issue Oct 7, 2022 · 2 comments · Fixed by #1575
Closed
3 tasks done
Labels
build Related to the build system enhancement New feature or request

Comments

@pkkummermo
Copy link

Describe the bug

When entering a page from outside the main index /, the hydration fails when trying to access the chunk in pathToFile requesting /assets/docs_quick-reference_index.md.undefined.lean.js leading to a Hydration completed but contains mismatches.

The underlying page loads successfully, but any further navigation is broken.

NOTE: This only occurs when there's a trailing slash.

The key being used is docs_quick-reference_index.md, but the key should be docs_quick-reference.md.

Reproduction

Set cleanUrls with with-subfolders or without-subfolders, add a page further down the content tree, build the project, and access it directly from the browser with a trailing slash.

Expected behavior

The lookup from __VP_HASH_MAP__ should be successful and correctly load the lean chunk making the page interactive.

System Info

System:
    OS: Linux 5.10 Ubuntu 18.04.6 LTS (Bionic Beaver)
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 16.96 GB / 23.44 GB
    Container: Yes
    Shell: 5.4.2 - /usr/bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.17 - ~/.npm-global/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.0/bin/npm
  npmPackages:
    vitepress: ^1.0.0-alpha.19 => 1.0.0-alpha.19

Additional context

Possible solution could be to check for both an index.md key as well as a stripped key to cover both use cases.

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@pkkummermo pkkummermo added the bug: pending triage Maybe a bug, waiting for confirmation label Oct 7, 2022
@brc-dd brc-dd removed the bug: pending triage Maybe a bug, waiting for confirmation label Oct 7, 2022
@brc-dd
Copy link
Member

brc-dd commented Oct 7, 2022

Yeah, we are aware of this. Ideally we want with-subfolders option to generate /foo/index.html and serve it properly at /foo/. But it's sort of blocked by #285. There might be other ways to fix this, but I believe supporting permalinks is crucial to solving many of similar issues.

@brc-dd brc-dd added enhancement New feature or request build Related to the build system labels Oct 7, 2022
@pkkummermo
Copy link
Author

Let me know if you want a PR based on the proposed solution, and I'll create one :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Related to the build system enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants