-
Notifications
You must be signed in to change notification settings - Fork 252
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
Hook useDoc is called outside the <DocProvider>. #580
Comments
🎉 Thanks for opening your first issue here! Welcome to the community! |
Hi @tripheo0412, it's difficult to debug without seeing your lock and package.json files, but this error is caused by a mismatch in plugin and Docusaurus versions. Please see the compatibility matrix in the README for more info. |
@sserrata hi! We use the exact package.json in the demo folder on branch v2.0.0 |
Hi @tripheo0412, that may be the case but it's not deterministic on its own - the packages that ultimately get installed are also dependent on the lock file and the ranges allowed in package.json. My advice is to scrub your lock file to ensure consistent versioning for Docusaurus and the plugin. Also, instead of starting from the demo, begin with a base docusaurus project.
|
@sserrata we did delete node_modules and lock file in between try combinations of docusaurus version 2.3.1/2.4.0/2.4.1 with the plugins + theme version v2.0.0-beta.3 Docusaurus v2.2.0 works perfectly with plugins + theme v1.7.3 It just I'm excited with the beta and want to try it out :) Thank you for your work 🙏 |
@sserrata Do you plan on supporting this for the latest version of Docusaurus anytime soon? |
I'm continuing to get this issue, and have rolled back everything progressively (all the way back to Docusaurus 2.2.0 / Plugin 1.4.4, which was said to work in this comment ) with no success, I assume its something else going on in my config. was there any progress on getting to the root of this? |
Any fix? I have the same issue. |
Same issue here. When I remove these lines from the config it goes away
|
I'm getting this same error with these versions: Error:
One things, I'm doing is using this plugin with a 2nd installation of the
related to #726 |
I'm getting the same error with both docusaurus v3.0.1 and v3.1.1 against v3.0.0-beta.10, but I'm not using a second installation of the docs plugin. There was some discussion of this in #654 and the recommendation was to set docs: {
sidebarPath: require.resolve('./sidebars.js'),
docItemComponent: '@theme/ApiItem',
docRootComponent: '@theme/DocRoot',
}, I've tried many different version pairings between docusaurus and the plugin, and I get the same error each time. @johnrengelman Do you still get the same error if you remove your second docs installation? |
FWIW, the |
Yes, there must have been a dependency conflict in my case. I had already been deleting |
running a |
Update:I've managed to get this to work! The issue as indeed conflicting versions of docusaurus, in addition to facebook/docusaurus#8091 IssueI'm seeing a similiar issue to @sangaline (and also with or without docRoot in synapsecns/sanguine#2603 My repo is open source so this is pretty easy to replicate:
Error output looks like this: ![]()
Interestingly enough it works here: synapsecns/sanguine@a6cedda when yarn workspaces not in use. I've tried everything (nohoist, etc). Anyone have any ideas? Would like to solve the root issue but not sure what it is So far, I've tried:
interestingly enough though, the yarn why after running this indicates only one version after running this (see here ) I mostly wanna figure out the root issue so I can try to see where it's coming from. After running yarn why, it seems like I have two different versions of
|
As stated before, this error is associated with mismatches between docusaurus deps and the plugin. |
Describe the bug
And using demo folder from the repo.
With
2.0.0-beta.3
Whenever render any page with API docs using@theme/ApiItem
I gotHook useDoc is called outside the <DocProvider>.
Expected behavior
Docusaurus render without issue.
Current behavior
Got error when render API docs page
Steps to reproduce
git clone https://github.com/PaloAltoNetworks/docusaurus-openapi-docs.git
git checkout v2.0.0
yarn install
yarn start
Screenshots
Your Environment
2.4.0
, plugin-openapi-docs and theme2.0.0-beta.3
, yarn1.22.19
The text was updated successfully, but these errors were encountered: