Skip to content

2.0.0-alpha.73 Markdown Frontmatter can't handle empty description #4652

Closed

Description

@TomPeirs

🐛 Bug Report

(A clear and concise description of what the bug is)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

To Reproduce

  1. I updated to the latest version of docusaurus
  2. NPM run start
  3. Have a simple MD file with an empty description frontmatter:
    image

Expected behavior

Build and compile without an issue. (was working in the previous version)

Actual Behavior

ValidationError: "description" must be a string
    at Object.exports.process (D:\Prototype\alpha72\node_modules\joi\lib\errors.js:184:16)
    at Object.internals.entry (D:\Prototype\alpha72\node_modules\joi\lib\validator.js:150:26)
    at Object.exports.entry (D:\Prototype\alpha72\node_modules\joi\lib\validator.js:27:30)
    at internals.Base.validate (D:\Prototype\alpha72\node_modules\joi\lib\base.js:548:26)
    at Object.internals.assert (D:\Prototype\alpha72\node_modules\joi\lib\index.js:225:27)
    at Object.attempt (D:\Prototype\alpha72\node_modules\joi\lib\index.js:107:26)
    at Object.assertDocFrontMatter (D:\Prototype\alpha72\node_modules\@docusaurus\plugin-content-docs\lib\docFrontMatter.js:22:28)
    at Object.processDocMetadata (D:\Prototype\alpha72\node_modules\@docusaurus\plugin-content-docs\lib\docs.js:66:22) 
    at processVersionDoc (D:\Prototype\alpha72\node_modules\@docusaurus\plugin-content-docs\lib\index.js:89:35)        
    at Array.map (<anonymous>)
    at loadVersionDocsBase (D:\Prototype\alpha72\node_modules\@docusaurus\plugin-content-docs\lib\index.js:96:45)      
    at async loadVersion (D:\Prototype\alpha72\node_modules\@docusaurus\plugin-content-docs\lib\index.js:100:34)       
    at async Promise.all (index 0)
    at async Object.loadContent (D:\Prototype\alpha72\node_modules\@docusaurus\plugin-content-docs\lib\index.js:167:33)    at async D:\Prototype\alpha72\node_modules\@docusaurus\core\lib\server\plugins\index.js:53:46
    at async Promise.all (index 0)

Your Environment

  • Docusaurus version used: 2.0.0-alpha.73

Activity

  1. added
    bug
    status: needs triage
    on Apr 20, 2021
  2. slorber commented on Apr 21, 2021

    @slorber
    Collaborator

    This will be fixed in #4654

    Also reported here: #4591 (comment)

    However, can you explain the motivation for having an empty description in that doc?

    The goal of this new validation system is to prevent users from doing weird things, and I believe it's a bit weird to use an empty doc description?

  3. TomPeirs commented on Apr 21, 2021

    @TomPeirs
    Author

    Thanks for pointing this out.

    It's indeed not correct to have empty descriptions indeed. I also just found this as a bug in our repository only after updating.
    We basically convert our books from XML to MD via pandoc and I wasn't aware that in a few cases this was empty. But we solved it already on our side. Just wanted to bring it up.

    I will try to do a bit more my best to find duplicate issues before reporting them ;-)
    I must have overlooked them.

  4. slorber commented on Apr 21, 2021

    @slorber
    Collaborator

    Np :)

    We'll add support for retrocompatibility but maybe we'll remove this someday or emit some kind of warning instead

  5. removed
    status: needs triage
    on Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions