front matter validation does not print a good error message
See original GitHub issueHave you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clear
oryarn 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
ValidationError: "title" must be a string
without context, I don’t know where to look at
https://github.com/wenerme/wener/actions/runs/3286799524/jobs/5415286638
Reproducible demo
No response
Steps to reproduce
git clone git@github.com:wenerme/wener.git
cd wener/site
pnpm install
make build
Expected behavior
Works as before
Actual behavior
[ERROR] The following front matter:
---
title: null
---
contains invalid values for field(s): `title`.
- "title" must be a string
[ERROR] Loading of version failed for version current
[ERROR] Unable to build website for locale en.
[ERROR] ValidationError: "title" must be a string
Your environment
- Public source code: https://github.com/wenerme/wener
- Public site URL: https://wener.me
- Docusaurus version used: 2.1.0
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
Self-service
- I’d be willing to fix this bug myself.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
How to Write Good Error Messages - UX Planet
Be concise and write a short description that is meaningful for user and gives him a clear idea of the problem and how...
Read more >Joi validation error does not provide detailed ... - GitHub
When Joi validation fails, I expect the server response to contain message and validation properties with detailed error information. What was ...
Read more >Designing Better Error Messages UX - Smashing Magazine
Let's explore when error messages should live above input fields and why toast error messages are usually not a very good idea.
Read more >Displaying Error Messages with Thymeleaf in Spring - Baeldung
In this tutorial, we'll see how to display error messages originating from a Spring-based back-end application in Thymeleaf templates.
Read more >Jekyll YAML front matter validator - Runar Ovesen Hjerpbakk
A simple script that validates Jekyll YAML front matter according to specific rules verifying that a Jekyll blog will build correctly.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t know is this related or not, but the katex error is also masked
https://github.com/wenerme/wener/actions/runs/3296716113/jobs/5436697247
Have no idea which file(maybe this https://github.com/wenerme/wener/blob/master/notes/algorithm/ml/cs221-reflex.md), which line cause the error.
EDIT
cause is founded but the problem is missing file context
@shermanhui as mentioned above, if you want to contribute you can directly open a PR. If I have to spend time explaining things to you, it will be faster for me to solve the bug myself. Error Cause is a standard EcmaScript feature, you will find everything on Google or in the spec
@shanpriyan opened a PR already so it is too late now for this issue, but you can open a PR to another one if you want