Closed dkobran closed 2 years ago
I tried 2.0.0-beta.15
just to see if it was a version issue and I got the same result
I'm seeing this too.
I fixed this - I have a page locally which had no <main>
content element which was missing the required meta tags.
I ran in to this bug too and found out it was because I had a page without a <Layout>
. Adding import Layout from '@theme/Layout';
and wrapping the page in <Layout>
fixed it.
@homotechsual @JulesBlm I am running into the same issue, could explain what is
This has resurfaced on Beta16
without changes to the rest of the code.
For Beta16
this is a breaking change caused by https://github.com/facebook/docusaurus/pull/6707
The solution would either be adjusting to look for the now default docsearch:docusaurus_tag
meta element or overriding the SearchMetadata
component to include the former defaults:
{language && <meta name="language" content={language} />}
{version && <meta name="version" content={version} />}
{tag && <meta name="docusaurus_tag" content={tag} />}
I've tested this by swizzling that component and re-adding those and it allows builds on B16.
Thanks for figuring this out @homotechsual!
@slorber what is the recommended way to go forward here? This plugin used the docusaurus_version
to figure out the version of pages when indexing. Should we overwrite the SearchMetadata
component to re-add it, or should we simply use docsearch:version
now?
sorry missed the notification
I'm going to restore/duplicate those tags so that nobody is affected any more
Pages will be a bit heavier but not much 🤷♂️ not sure how to deal with this to make it convenient for most users and at the same time it doesn't look great if you read algolia meta in third-party plugins
Thank you @slorber!
As for the original issue, please make sure to wrap your custom pages in <Layout>
from @theme/layout
, like you can see here: https://github.com/cmfcmf/docusaurus-search-local/blob/84c72c3d98c6e0d578c7799274f4a33a896c1425/packages/example-docs/src/pages/index.js#L31-L38
Please let me know if you continue to encounter this issue with the latest Docusaurus beta (v2.0.0-beta.17), then I'm happy to reopen this.
Please describe the bug you are seeing
I am unable to successfully run
yarn build
after installing this plugin.How can we best reproduce the bug?
I just followed the two steps from the instructions:
and adding the plugin to
docusaurus.config.js
with:When I run
yarn build
, I get this error:Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?
yarn list v1.22.17 ├─ @cmfcmf/docusaurus-search-local@0.10.0 ├─ @docusaurus/core@2.0.0-beta.14 ├─ @docusaurus/cssnano-preset@2.0.0-beta.14 ├─ @docusaurus/logger@2.0.0-beta.14 ├─ @docusaurus/mdx-loader@2.0.0-beta.14 ├─ @docusaurus/plugin-content-blog@2.0.0-beta.14 ├─ @docusaurus/plugin-content-docs@2.0.0-beta.14 ├─ @docusaurus/plugin-content-pages@2.0.0-beta.14 ├─ @docusaurus/plugin-debug@2.0.0-beta.14 ├─ @docusaurus/plugin-google-analytics@2.0.0-beta.14 ├─ @docusaurus/plugin-google-gtag@2.0.0-beta.14 ├─ @docusaurus/plugin-sitemap@2.0.0-beta.14 ├─ @docusaurus/preset-classic@2.0.0-beta.14 ├─ @docusaurus/react-loadable@5.5.2 ├─ @docusaurus/theme-classic@2.0.0-beta.14 ├─ @docusaurus/theme-common@2.0.0-beta.14 ├─ @docusaurus/theme-search-algolia@2.0.0-beta.14 ├─ @docusaurus/theme-translations@2.0.0-beta.14 ├─ @docusaurus/utils-common@2.0.0-beta.14 ├─ @docusaurus/utils-validation@2.0.0-beta.14 └─ @docusaurus/utils@2.0.0-beta.14
Which Node.js version are you using?
v16.13.2
Which theme are you using?
Yes, I am using @docusaurus/theme-classic
How does your plugin config look like?
Additional context
No response