Giter Site home page Giter Site logo

Comments (5)

gustavwennerblom avatar gustavwennerblom commented on June 17, 2024 1

I had this problem too, but upgrading all @docusaurus packages to 3.1.1 solved the problem for me.

from redocusaurus.

erodewald avatar erodewald commented on June 17, 2024 1

I had this problem too, but upgrading all @Docusaurus packages to 3.1.1 solved the problem for me.

I had been putting off that version bump due to the typical instabilities, but after upgrading to 3.1.1 it is working again 👍. One noteworthy additional dependency bump was styled-components. 5.x.x => 6.x.x to resolve a redoc-specific issue.

Could you share how you are using <ApiSchema> and <Redoc>?

Sure, although I have no concern if you decide it isn't worth trying to remediate.

In my index.js, I have an exported component wrapping a container with <Layout>:

function Home() {
	const context = useDocusaurusContext();
	const { siteConfig = {} } = context;
  	const [isSearchBarExpanded, setIsSearchBarExpanded] = useState(false);

	return (
		<div className="homepage">
			<Layout
				description={`${siteConfig.description}`}
			>

				<header className={classnames('hero', styles.heroBanner)}>
					<div className={`container ${styles.homepageTitle}`}>
						<h1 className={styles.titleLine1}>
							{siteConfig.customFields.displayTitle.titleLine1}
						</h1>
						<div className={styles.body}>
							<p>{siteConfig.customFields.displayTitle.body}</p>
						</div>
						<SearchBar className='homepage-search'
							handleSearchBarToggle={setIsSearchBarExpanded}
							isSearchBarExpanded={isSearchBarExpanded}
						/>  
					</div>
				</header>
				<main className='main-container'>
					{features && features.length && (
						<section className={styles.features}>
							<div className={classnames('container', styles.container) }>
								<div className={classnames('row', styles.row)}>
									{features.map((props, idx) => (
										<Feature key={idx} {...props} />
									))}
								</div>
							</div>
						</section>
					)}
				</main>
			</Layout>
		</div>
	);
}

export default Home;

And within an .md document, I reference a schema example.

<ApiSchema id="enterprise-remote" example pointer="#/components/schemas/MyRequest" />

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on June 17, 2024 1

I think if upgrading to 3.1.1 fixes then we can close it. If it resurfaces again then will take a look.

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on June 17, 2024

Could you share how you are using <ApiSchema> and <Redoc>?

The stack trace indicates it might not be from there and instead be from Redoc component

ReactContextError
    at useColorMode (webpack-internal:///./node_modules/@docusaurus/theme-common/lib/contexts/colorMode.js:28:1533)
    at useSpecOptions (webpack-internal:///./node_modules/docusaurus-theme-redoc/dist-jsx/utils/useSpecOptions.js:18:243)
    at Redoc (webpack-internal:///./node_modules/docusaurus-theme-redoc/dist-jsx/theme/Redoc/Redoc.jsx:20:178)

from redocusaurus.

MorelSerge avatar MorelSerge commented on June 17, 2024

I just had this issue after upgrading to Docusaurus 3.2 and bumped on this thread, seems like this resurfaced in 3.2 @rohit-gohri

Edit: Fixed it. After upgrading to 3.2, I now had @docusaurus/theme-common installed twice (3.1.1 and 3.2.0).
Sorry for the email bump, hope this helps other people.

from redocusaurus.

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.