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

fix(theme-algolia): useDocusaurusContext import error #10382

Merged
merged 10 commits into from
Aug 9, 2024

Conversation

anaclumos
Copy link
Contributor

Motivation

After updating to Docusaurus v3.5, I got:

image

Which I diagnosed:

image

Which can be fixed with:

image

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 9, 2024
@anaclumos
Copy link
Contributor Author

Please disregard the commit history that shows 2022. I used the same forked repository, which is displaying the commit history from 2 years ago.

Copy link

netlify bot commented Aug 9, 2024

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 6d5a970
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/66b656f2120a1d0008bc44a7
😎 Deploy Preview https://deploy-preview-10382--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Aug 9, 2024

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🟠 69 🟢 98 🟢 96 🟢 100 Report
/docs/installation 🟠 55 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 74 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 69 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🔴 48 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 70 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 74 🟢 100 🟢 100 🟠 86 Report

@Josh-Cena Josh-Cena linked an issue Aug 9, 2024 that may be closed by this pull request
7 tasks
@Josh-Cena Josh-Cena changed the title (chore) Docusaurus 3.5 Algolia useDocusaurusContext Import Fix fix(theme-algolia): useDocusaurusContext import error Aug 9, 2024
Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks😅

Our website build succeeds because we build using our own codebase which has the TS source; the E2E tests pass because they don't use the Algolia theme!

@Josh-Cena
Copy link
Collaborator

@anaclumos Have you tried with this fix locally to see if the website builds successfully? Just afraid there may be similar errors.

@anaclumos
Copy link
Contributor Author

Yes. I overrode the dependencies using npm workspaces with the following modifications. It successfully compiles. Here is a PoC:

anaclumos/extracranial@02374fe

Seems like Docusaurus 3.5 moved/repackaged some internal libraries? I had to make other fixes that I swizzled before.

@Josh-Cena
Copy link
Collaborator

Seems like Docusaurus 3.5 moved/repackaged some internal libraries?

Yeah we did, which was the PR that broke this: #10316

@Josh-Cena Josh-Cena merged commit 584eec9 into facebook:main Aug 9, 2024
37 checks passed
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Aug 9, 2024
@slorber slorber mentioned this pull request Aug 9, 2024
@slorber
Copy link
Collaborator

slorber commented Aug 9, 2024

proper fix released in v3.5.1

Let me know if this works well for you

michaelklishin added a commit to rabbitmq/rabbitmq-website that referenced this pull request Aug 9, 2024
For when facebook/docusaurus#10382
ships in a patch release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail to upgrade to docusaurus3.5 with theme-search-algolia
4 participants