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

Adding second API reference to sidebar results in Hook usedoc error #726

Open
cdstull opened this issue Feb 22, 2024 · 2 comments
Open

Adding second API reference to sidebar results in Hook usedoc error #726

cdstull opened this issue Feb 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@cdstull
Copy link

cdstull commented Feb 22, 2024

Describe the bug

When I add a second API reference to my site it results in a "Hook useDocsVersion is called outside the .

Expected behavior

Both API references should be on the sidebar.

Current behavior

The files generate from the spec but the moment I add a second API ref to my sidebars.ts the site breaks. When I comment one API ref out of sidebars.ts the error stops and the site works again. Each API reference works individually, just not together.

Possible solution

I'm assuming this is a compatibility issue with Docusaurus 3. I've tried every combination of Docusaurus 3.0.0 and after with every combination of the plugin beta 3.0.0.-beta1 and after and I've gotten the same result every time.

Steps to reproduce

  1. Use a second spec and generate the files in another directory
  2. Add the second API reference to the sidebar file
  3. Site crashes

Screenshots

adding second api ref to sidebar

Hook error

sidebars commented out

If I comment one API ref out, then the site works. This is true regardless of which API ref I comment out.

Context

Need two distinct API references on the same sidebar.

Your Environment

  • Version used: Docusaurus 3.0.0 and docusaurus-plugin-openapi-docs 3.0.0-beta.1; also tried with the latest Docusaurus and the latest plugin beta and get same results
  • Environment name and version:
  • Operating System and version: macOS 14.3
  • Link to your project: not yet public
@cdstull cdstull added the bug Something isn't working label Feb 22, 2024
@sserrata
Copy link
Member

Hi @cdstull, thanks for opening the issue. Given the information provided I'm not sure what the issue could be. FWIW, we currently build/deploy a Docusaurus v3 site and plugin with multiple specs referenced in a single sidebar:

Preview: https://docusaurus-openapi-36b86--pr660-knd150qi.web.app/category/petstore-api
PR: #660

@johnrengelman
Copy link

Same issue here when using the beta.10 version along with core 3.1.1 and using a 2nd docs plugin to host the apis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants