Have you read the Contributing Guidelines on issues?
Prerequisites
Description
Faced error when tried to build the application with metadata: [{name: 'robots', content: 'noindex'}] set in docusaurus.config.js. This is a recommended way of hiding the website from search crawlers. I was also able to avoid the issue by using an alternative way of applying noindex in metadata.
Reproducible demo
https://github.com/chernodub/docusaurus-build-issue-repro
Steps to reproduce
With attached demo:
- Clone the repo
npm install
npm run build
With clean docusaurus build:
npx create-docusaurus@latest my-website classic
cd my-website
- Add
metadata: [{name: 'robots', content: 'noindex'}] to docusaurus.config.js
npm run build
Expected behavior
npm run build finishes without errors
Actual behavior
npm run build fails with an error
node:events:505
throw er; // Unhandled 'error' event
^
EmptySitemap: You ended the stream without writing anything.
Emitted 'error' event on SitemapStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Your environment
- Docusaurus version used:
2.0.0-beta.22
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
Node.js 16.6.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
macOS Monterey 12.4
Self-service
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clearoryarn clearcommand.rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages.Description
Faced error when tried to build the application with
metadata: [{name: 'robots', content: 'noindex'}]set indocusaurus.config.js. This is a recommended way of hiding the website from search crawlers. I was also able to avoid the issue by using an alternative way of applyingnoindexin metadata.Reproducible demo
https://github.com/chernodub/docusaurus-build-issue-repro
Steps to reproduce
With attached demo:
npm installnpm run buildWith clean docusaurus build:
npx create-docusaurus@latest my-website classiccd my-websitemetadata: [{name: 'robots', content: 'noindex'}]todocusaurus.config.jsnpm run buildExpected behavior
npm run buildfinishes without errorsActual behavior
npm run buildfails with an errorYour environment
2.0.0-beta.22Node.js 16.6.0macOS Monterey 12.4Self-service