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

Docusarus 3.6.0 upgrade breaks this package #1013

Open
Celtech opened this issue Nov 4, 2024 · 18 comments
Open

Docusarus 3.6.0 upgrade breaks this package #1013

Celtech opened this issue Nov 4, 2024 · 18 comments
Labels
bug Something isn't working

Comments

@Celtech
Copy link

Celtech commented Nov 4, 2024

Describe the bug

If you upgrade a docusarus site to the 3.6.0 release it will trigger the following error when you do a yarn start

Hook useScrollController is called outside the <ScrollControllerProvider>. 
ReactContextError
    at useScrollController (webpack-internal:///./node_modules/docusaurus-theme-openapi-docs/node_modules/@docusaurus/theme-common/lib/utils/scrollUtils.js:27:145)
    at useScrollPositionBlocker (webpack-internal:///./node_modules/docusaurus-theme-openapi-docs/node_modules/@docusaurus/theme-common/lib/utils/scrollUtils.js:45:63)
    at TabList (webpack-internal:///./node_modules/docusaurus-theme-openapi-docs/lib/theme/MimeTabs/index.js:6:2109)
    at renderWithHooks (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:15487:18)
    at mountIndeterminateComponent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:20099:13)
    at beginWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21622:16)
    at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4165:14)
    at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4214:16)
    at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4278:31)
    at beginWork$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:27486:7)

Expected behavior

Current behavior

Possible solution

Steps to reproduce

Screenshots

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:
@pmarschik
Copy link

I've done the upgrade to docusaurus 3.6.0 but I've also upgraded docusaurus-openapi-docs to 4.2.0 in the same change.
With 4.2.0 I don't get the error you describe.

In the mentioned PR docusaurus-openapi-docs is still on 4.1.0 so maybe upgrading to 4.2.0 helps?

@sschuberth
Copy link

In the mentioned PR docusaurus-openapi-docs is still on 4.1.0 so maybe upgrading to 4.2.0 helps?

Do you mean these? If I'm reading the lockfile correctly, both docusaurus-plugin-openapi-docs and docusaurus-theme-openapi-docs are at version 4.2.0 already.

@pmarschik
Copy link

Yes. Interesting, must be some other issue then since I couldn't reproduce your issue and I'm using docusaurus 3.6.0 + @docusaurus/faster + docusuarus-openapi-docs 4.2.0.

@alvinometric
Copy link

Also getting the same issue with Hook useScrollController is called outside the <ScrollControllerProvider> when upgrading to Docusaurus 3.6 and version 4.2 of this plugin

@sserrata
Copy link
Member

sserrata commented Nov 5, 2024

Issues like these are almost always due to dependency mismatches, especially between Docusaurus deps. You can try deleting yarn.lock and reinstalling for a quick fix.

@alvinometric
Copy link

@sserrata Unfortunately this seems to persist even with:

  • a fresh lockfile
  • deleting the generated mdx files
  • upgrading to the canary release of this plugin (both the theme and the plugin)

@sserrata
Copy link
Member

sserrata commented Nov 5, 2024

Ah, I just realized you may still be on 4.2.0, which doesn't support Docusaurus 3.6.0. If that's the case, can you upgrade to the latest canary release?

@sserrata
Copy link
Member

sserrata commented Nov 5, 2024

Just read your latest comment...not sure what the issue could be since the demo site is currently on Docusaurus 3.6.0 and I've not been able to repro locally.

@ianbaek
Copy link

ianbaek commented Nov 8, 2024

I had the same issue of 'Hook useScrollController is called outside the ' after updating to 4.2.0 at Docusarus 3.5.2. Upgrading Docusarus to 3.6 in my case solved the issue. It might be some dependency issue but could not find exactly what caused the issue.

@otuoche
Copy link

otuoche commented Nov 11, 2024

i am still having the same issue too

@ChrisSargent
Copy link

yarn dedupe solved it for us

sschuberth added a commit to doubleopen-project/ort-server that referenced this issue Nov 13, 2024
Run `pnpm dedupe` as a preparation for upgrading Docusaurus as suggested
at [1].

[1]: PaloAltoNetworks/docusaurus-openapi-docs#1013 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
github-merge-queue bot pushed a commit to eclipse-apoapsis/ort-server that referenced this issue Nov 13, 2024
Run `pnpm dedupe` as a preparation for upgrading Docusaurus as suggested
at [1].

[1]: PaloAltoNetworks/docusaurus-openapi-docs#1013 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth
Copy link

yarn dedupe solved it for us

Didn't help in our case.

@ChrisSargent
Copy link

well..... yarn dedupe solved the useScrollController error but not another one that we get just from doing the openapi plugin upgrade so 🤷

@fpauer
Copy link

fpauer commented Nov 28, 2024

I just tried to go over the initial steps

npx [email protected] my-website --package-manager yarn
...
cd my-website
yarn start

And even the example demo does not work 👎 , I would say frustrating, I tried to force all docusaurus packages to be version 3.5.2 , also does not work.

Hook useScrollController is called outside the <ScrollControllerProvider>. 
ReactContextError
    at useScrollController (webpack-internal:///./node_modules/docusaurus-theme-openapi-docs/node_modules/@docusaurus/theme-common/lib/utils/scrollUtils.js:27:145)
    at useScrollPositionBlocker (webpack-internal:///./node_modules/docusaurus-theme-openapi-docs/node_modules/@docusaurus/theme-common/lib/utils/scrollUtils.js:45:63)

@IanVS
Copy link
Contributor

IanVS commented Dec 11, 2024

I had problems upgrading from docusaurus 3.5 and plugin version 4.2 to 3.6 and 4.3 respectively. A pnpm dedupe solved it. It was still somehow using docusaurus 3.5 due to some transitive dependency chain that I didn't investigate too much.

@vtempest
Copy link

vtempest commented Dec 15, 2024

             Error: Can't render static file for pathname "/petstore31/user" 
       message: 'Hook useDocsSidebar is called outside the <DocsSidebarProvider>. '

similar issue with 4.3

reverting to 4.2 and 361 fixed

@vtempest
Copy link

TypeError: Cannot read properties of null (reading 'store')
              at useSelector (server.bundle.js:45677:34)


    var _useReduxContext = useReduxContext(),
        store = _useReduxContext.store,

Docusaurus version: 3.5.2
Node version: v22.12.0
"docusaurus-plugin-openapi-docs": "4.2.0",

@crypblizz8
Copy link

crypblizz8 commented Jan 7, 2025

What worked for me (as dedupe did not work for me)

// package.json

    "dependencies": {
        ...
        "docusaurus-plugin-openapi-docs": "4.2.0",
        "@docusaurus/core": "3.5.2",
        "@docusaurus/preset-classic": "3.5.2",
        "@docusaurus/theme-search-algolia": "3.5.2",
       ...
    }
    
     "resolutions": {
        "@docusaurus/core": "3.5.2",
        "@docusaurus/theme-common": "3.5.2",
        "docusaurus-theme-openapi-docs": "4.2.0"
     }

and

rm -rf node_modules yarn.lock
yarn install

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