Skip to content
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

Metadata robots noindex causes build error #7772

Closed
4 of 7 tasks
chernodub opened this issue Jul 13, 2022 · 2 comments · Fixed by #7774
Closed
4 of 7 tasks

Metadata robots noindex causes build error #7772

chernodub opened this issue Jul 13, 2022 · 2 comments · Fixed by #7774
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@chernodub
Copy link
Contributor

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

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:

  1. Clone the repo
  2. npm install
  3. npm run build

With clean docusaurus build:

  1. npx create-docusaurus@latest my-website classic
  2. cd my-website
  3. Add metadata: [{name: 'robots', content: 'noindex'}] to docusaurus.config.js
  4. 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

  • I'd be willing to fix this bug myself.
@chernodub chernodub added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jul 13, 2022
chernodub added a commit to chernodub/docusaurus that referenced this issue Jul 13, 2022
Currently, the recommended approach is [not working](facebook#7772). By using an alternative, working, approach, we prevent people from facing issues.
@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Jul 14, 2022
@Miguelsalgado072888

This comment was marked as spam.

@Miguelsalgado072888

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants