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

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

Closed
TomPeirs opened this issue Apr 20, 2021 · 3 comments
Closed

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

TomPeirs opened this issue Apr 20, 2021 · 3 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@TomPeirs
Copy link

🐛 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
@TomPeirs TomPeirs 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 Apr 20, 2021
@slorber
Copy link
Collaborator

slorber commented Apr 21, 2021

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?

@TomPeirs
Copy link
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.

@slorber
Copy link
Collaborator

slorber commented Apr 21, 2021

Np :)

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

@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Feb 26, 2022
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

No branches or pull requests

3 participants