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
Internal Context Providers are not available (<DocsSidebarProvider />) #9094
Comments
You probably have some duplicate packages in your node modules. Did you also upgrade at the same time, or the only change was the package manager? Can I see a failing PR or something that clearly shows a diff? (ok before, failing after) |
Hey @slorber! I did upgrade only to see if that would fix my issue. I went from 2.4.0 to 2.4.1. I just created this PR: TBD54566975/developer.tbd.website#564
The |
Your pnpm branch is working for me locally with start/build and pnpm 8.6.3: Try Netlify CI does show an error though but it's not the same that the one you reported Try also to clear the netlify cache and rebuild? |
Apparently, you got it working on Netlify a few hours ago, so I assume the problem is fixed 🤷♂️ Not sure we can do anything on the Docusaurus codebase anyway so I'm going to close |
Hey @slorber, I was gonna do some experimenting this morning before updating this issue, but here is what ended up being the fix: Perhaps removing @docusaurus/types from being an optional dependency would be the answer for pnpm users? Not sure if that might cause issues elsewhere, though. |
Thanks That looks related to a few issues we have (also this one: #9080) Will need to investigate this a bit but that seems reasonable to include the types as direct deps (even for JS projects, considering we use JSDoc types in the site config) |
came across this at: https://github.com/rpldy/react-uploady-docs fixed by removing |
When this happens this is usually because there are competing versions of the same package in your repo. Double-checking your dependencies, and regenerating your lockfile is usually a good idea. |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
I am converting a docs site to a monorepo by switching to pnpm. Everything seemed to run fine when I was using
npm
, however, after switching topnpm
, I'm getting ReactContext errors.On our
/learn
path, I get this error:Some how the
<DocsSidebarProvider />
isn't being wrapped around the Docusaurus app.Thank you in advanced!
Reproducible demo
https://github.com/TBD54566975/developer.tbd.website/tree/pnpm
Steps to reproduce
Step 1:
pnpm i
Step 2:
pnpm build
Or if you run
pnpm start
and navigate to the/learn
URL, you'll see the ContextProvider error.Expected behavior
I expect that there should be no errors because the appropriate ContextProviders are in place.
Actual behavior
Throwing error that says useDocsSidebar hook is being used outside of
<DocsSidebarProvider />
Your environment
Self-service
The text was updated successfully, but these errors were encountered: