Closed octogonz closed 2 years ago
docusaurus.config.js
contextualSearch: true
When you try to render the page, search is broken because of a JavaScript error saying that the docusaurus_tag field is missing from the server response. The crawler was looking for an HTML tag like this:
docusaurus_tag
<meta data-react-helmet="true" name="docsearch:docusaurus_tag" content="docs-default-current">
...but it is missing from the HTML pages. Why? The @theme/SearchMetadata hook is supposed to render it.
@theme/SearchMetadata
It is not found because the file path is spelled incorrectly as SearchMetadatas instead of SearchMetadata.
SearchMetadatas
SearchMetadata
Rename src/theme/SearchMetadatas/ --> src/theme/SearchMetadata/
src/theme/SearchMetadatas/
src/theme/SearchMetadata/
Thank you @octogonz!
Wonder if that file name was changed in a recent version of Docusaurus...
Will test and report
Change Summary
Problem
docusaurus.config.js
to setcontextualSearch: true
When you try to render the page, search is broken because of a JavaScript error saying that the
docusaurus_tag
field is missing from the server response. The crawler was looking for an HTML tag like this:...but it is missing from the HTML pages. Why? The
@theme/SearchMetadata
hook is supposed to render it.It is not found because the file path is spelled incorrectly as
SearchMetadatas
instead ofSearchMetadata
.Solution
Rename
src/theme/SearchMetadatas/
-->src/theme/SearchMetadata/
PR Checklist