Giter Site home page Giter Site logo

Comments (13)

sserrata avatar sserrata commented on September 14, 2024 11

Hi everyone, I opened a PR that adds support for Docusaurus 3.5.0+. As mentioned before, this change requires breaking backward compatibility.

from docusaurus-openapi-docs.

santhoshmurthybk avatar santhoshmurthybk commented on September 14, 2024 5

Will there be a fix rolled out for this?

from docusaurus-openapi-docs.

anovis avatar anovis commented on September 14, 2024 2

nice! thanks for the fix. any timeline for when you think you will push this release to npm?

from docusaurus-openapi-docs.

Devon-White avatar Devon-White commented on September 14, 2024 1

I started working on a PR for this issue.

Upon upgrading the Docusaurus version, i tried two different approaches.

1st. I tried to swap the import path and continue to use the Unlisted component directly.
2nd. Swapped to using the ContentVisibility component and passing it the metadata gathered from the useDoc function.

Doing both of these approaches leaves me with the following error:

react-dom.development.js:28474 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `ApiItem`.
    at createFiberFromTypeAndProps (react-dom.development.js:28474:17)
    at createFiberFromElement (react-dom.development.js:28500:15)
    at reconcileSingleElement (react-dom.development.js:13987:23)
    at reconcileChildFibers (react-dom.development.js:14045:35)
    at reconcileChildren (react-dom.development.js:19182:28)
    at mountIndeterminateComponent (react-dom.development.js:20182:5)
    at beginWork (react-dom.development.js:21622:16)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4165:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4214:16)
    at invokeGuardedCallback (react-dom.development.js:4278:31)
react-dom.development.js:18705 The above error occurred in the <ApiItem> component:

If i make the APItem Component just render in a simple div, the error stops.

I'm still fairly new to React in general, so I haven't been able to discover what the root cause of the issue its. I'll continue to mess around in hopes that I can solve the issue, but a more experienced Developer might be able to make light work of this. :)

Edit: Seems to be coming from the DocProvider? I went down the list of removing components until the error stop. So it seems to be somewhere related with the props.contents and how the DocProvider is handling APIItems?

from docusaurus-openapi-docs.

robbieaverill avatar robbieaverill commented on September 14, 2024 1

I just tested the latest canary release 0.0.0-763 and things build correctly.

from docusaurus-openapi-docs.

robbieaverill avatar robbieaverill commented on September 14, 2024 1

Stable release v4.0.0 contains the fix for this

from docusaurus-openapi-docs.

sserrata avatar sserrata commented on September 14, 2024

Hi @Preston-Landers, seems to be an undocumented breaking change introduced here: https://github.com/facebook/docusaurus/pull/10376/files

from docusaurus-openapi-docs.

sserrata avatar sserrata commented on September 14, 2024

It's a fairly simple fix but may require breaking backward compatibility with prior releases.

from docusaurus-openapi-docs.

johnmcase avatar johnmcase commented on September 14, 2024

Hi @Preston-Landers, seems to be an undocumented breaking change introduced here: https://github.com/facebook/docusaurus/pull/10376/files

If this is a breaking change in docusaurus should an issue be opened there for them to fix?

from docusaurus-openapi-docs.

sserrata avatar sserrata commented on September 14, 2024

If this is a breaking change in docusaurus should an issue be opened there for them to fix?

You could, but I doubt it would lead to a fix. Over the years, we've come to expect breaking changes to land every so often, as the semantic versioning doesn't apply to some internals. That said, I looked into it earlier today and it seems the fix will not be trivial after all.

The bigger question is, if the solution does in fact break backward compatibility should we bump our plugin to v4?

from docusaurus-openapi-docs.

pcolby avatar pcolby commented on September 14, 2024

Stable release v4.0.0 contains the fix for this

Confirmed working for me now (with Docusaurus v3.5.2). Thanks!

from docusaurus-openapi-docs.

polgiron avatar polgiron commented on September 14, 2024

hello, I have installed the latest version v4.0.0, followed the readme to set up the plugin on an already set up docusaurus v3.5.2, deleted node_modules, yarn.lock and .docusaurus folder, re-installed all the packages, when I run yarn build I am facing this error:

Module not found: Error: Can't resolve '@theme/ApiItem' in 'xxx/.docusaurus'

what am I doing wrong please?

from docusaurus-openapi-docs.

IanVS avatar IanVS commented on September 14, 2024

@sserrata I attempted to upgrade to docusaurus 3.5.2 and version 4.0.1 of this plugin, and got errors. I found that some 3.4.0 docusaurus packages are still installed, I believe due to the range on

. This should be ^3.5.0, to ensure that an older, incompatible version of @docusaurus/theme-common is not used. I'll open a PR shortly.

from docusaurus-openapi-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.