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
TypeError: Cannot read properties of undefined (reading 'searchPagePath') using Typesense theme #8623
Comments
Hi Indeed it's the PR (#8539) that broke it by introducing Algolia-specific things to our theme-common package. Retrospectively that seems like a bad idea @Josh-Cena 😅 we'd rather not couple theme-common to anything apart from our 3 content plugins IMHO (btw the deps has not been added to package.json) However this breaks because the typesense plugin is using Docusaurus internal implementation details and we can't commit to not do changes that annoy plugins. CC @jasonbosco. There's also this bug reported on the Typesense repo here: typesense/docusaurus-theme-search-typesense#27 If the API is marked as "internal" you should not use it in your code (in particular in plugin code). I can see our internal If you need this code, for now, it's safer to copy/paste it and adapt it to your own need rather than using our internal export. Workaround that probably works: I'll keep this open for now because I think we should remove the theme-common => algolia dependency. But the refactor will likely break the typesense plugin again 😅. That's also why I'd prefer if the typesense plugin wasn't relying on this internal API @jasonbosco |
@slorber Thank you for the heads-up! I essentially forked the built-in Algolia plugin, so I missed noticing that these were internal methods. I've just been regularly syncing the Typesense plugin with upstream changes from the Algolia plugin all these months! 😅 I'll now refactor it to not rely on this internal method. Thank you for the pointers. |
I've published |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
I am running a fresh Docusaurus installation on the latest version (2.3.0), and I've been hitting this error every time I attempt to build my site with the
docusaurus-theme-search-typesense@next
theme.I have a cached older version that I tested this against, and it was able to build successfully. This seems to be an issue with 2.3.0, and I noticed #8539 mentions this
searchPagePath
variable.I wasn't able to get the sandbox to work the way I needed it to, but I've included the repro steps below along with a sample
docusaurus.config.js
.I've included some additional output below showing how I tested this. In the output below, I show I have docusaurus@2.2.0 installed, I installed typesense, and ran a build that succeeded. Then I upgraded Docusaurus, ran a build, and got the error.
Reproducible demo
No response
Steps to reproduce
yarn create docusaurus testdocs classic
docusaurus.config.js
with the one below.yarn add docusaurus-theme-search-typesense@next
cd
to thetestdocs
directoryyarn run build
Expected behavior
A successful build.
Actual behavior
Build failed.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: