The docusaurus build fails because of error with docusaurus-search-local plugin:
Unable to build website for locale en.
[ERROR] TypeError: Cannot read properties of undefined (reading 'load')
at html2text (/home/vsts/work/1/s/node_modules/@cmfcmf/docusaurus-search-local/lib/server/parse.js:79:33)
at /home/vsts/work/1/s/node_modules/@cmfcmf/docusaurus-search-local/lib/server/index.js:287:99
at async Promise.all (index 0)
at async Object.postBuild (/home/vsts/work/1/s/node_modules/@cmfcmf/docusaurus-search-local/lib/server/index.js:284:32)
at async /home/vsts/work/1/s/node_modules/@docusaurus/core/lib/commands/build.js:180:9
at async Promise.all (index 9)
at async buildLocale (/home/vsts/work/1/s/node_modules/@docusaurus/core/lib/commands/build.js:176:5)
at async tryToBuildLocale (/home/vsts/work/1/s/node_modules/@docusaurus/core/lib/commands/build.js:41:20)
at async mapAsyncSequential (/home/vsts/work/1/s/node_modules/@docusaurus/utils/lib/jsUtils.js:34:24)
at async Command.build (/home/vsts/work/1/s/node_modules/@docusaurus/core/lib/commands/build.js:76:21)
**your text**
When I exclude the search plugin build works fine.
Using the following versions:
Node: 18.16.0
"@easyops-cn/docusaurus-search-local": "^0.35.0"
Added following to docusaurus.config:
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
language: ["en", "de"],
docsRouteBasePath: ['docs'],
searchResultLimits: 12
},
Can you pls. help with inputs.
Tried upgrading node from 16 to 18.
Tried removing docusaurus search and then the build works fine. However, I do not see the search bar which is required.