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

Invalid search result url with docusaurus 3.4.0 #408

Closed
TimKolberger opened this issue Jun 3, 2024 · 8 comments · Fixed by #411
Closed

Invalid search result url with docusaurus 3.4.0 #408

TimKolberger opened this issue Jun 3, 2024 · 8 comments · Fixed by #411

Comments

@TimKolberger
Copy link

TimKolberger commented Jun 3, 2024

Starting with docusaurus@3.4.0 and docusaurus-search-local@0.41.0 the search results point to an invalid url.

Seems like an issue with the baseUrl.

Reproduction

  1. Go to https://timkolberger.github.io/docusaurus-plugin-structurizr
  2. Search for "CI Environments" and select the first result
  3. 404 Page
Screen.Recording.2024-06-03.at.12.35.08.mp4

Source: https://github.com/TimKolberger/docusaurus-plugin-structurizr/tree/main/apps/docs

@weareoutman
Copy link
Member

I found you're using actions/configure-pages to set baseUrl which has output.base_path not ending with / [1], as Docusaurus expected (at least our search plugin expects it).

Can you manually append / for baseUrl in https://github.com/TimKolberger/docusaurus-plugin-structurizr/blob/c6d224877bf2c5f389e0023825d7c565ed49d4fd/apps/docs/docusaurus.config.mts#L15 ?

[1] https://github.com/actions/configure-pages/blob/e1bedb377708461b49c882870df192bdec04b996/src/output-pages-base-url.test.js#L40

@TimKolberger
Copy link
Author

Thanks for the fast reply!

I added a trailing slash like you suggested, but the issue persists.

Commit TimKolberger/docusaurus-plugin-structurizr@16146d5

@TimKolberger
Copy link
Author

I encountered this issue on multiple docusaurus sites at work. The reproduction is just the only public one.
All docs deployed on GitLab Pages, GitHub Pages and nginx Deployments have the same issue.

Since this only occurred when renovate merged the docusaurus 3.4.0 updates, I think the issue is buried in this plugin code, or somewhere in the docusaurus router code (the release touched some routing code in docusaurus itself). But I could not pinpoint it yet.

@anonid-top
Copy link
Contributor

anonid-top commented Jun 3, 2024

@TimKolberger @weareoutman @easyops-eve
I already fixed this, how i can push my code to your repo?
Thank you!

@TimKolberger
Copy link
Author

@anonid-top looks like you created a fork of this repo (not mine). See this GitHub docs on how to create a PR from a fork: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

@anonid-top
Copy link
Contributor

anonid-top commented Jun 4, 2024

@TimKolberger I already make Pull Request by guide as this link, please help me check it is valid or not
I fork to my repo because tomorow i don't have permission and i don't know how to commit my change to your repo. Sorry for my bad knowledge

@weareoutman
Copy link
Member

@TimKolberger Try 0.41.1

Thanks to @anonid-top for helping to address the issue.

@TimKolberger
Copy link
Author

works as expected. Thank you!

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

Successfully merging a pull request may close this issue.

3 participants