PaloAltoNetworks / docusaurus-openapi-docs

🦝 OpenAPI plugin for generating API reference docs in Docusaurus v3.
https://docusaurus-openapi.tryingpan.dev
MIT License
702 stars 234 forks source link

Docusarus 3.6.0 upgrade breaks this package #1013

Open Celtech opened 1 day ago

Celtech commented 1 day ago

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

1. 2. 3. 4.

Screenshots

Context

Your Environment

pmarschik commented 1 day ago

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 commented 1 day ago

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 commented 1 day ago

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 commented 1 day ago

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 commented 1 day ago

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 commented 1 day ago

@sserrata Unfortunately this seems to persist even with:

sserrata commented 1 day ago

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 commented 1 day ago

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.