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

Frontmatter Parsing Failure Does Not Report Filename #2029

Open
1 task done
bliles opened this issue Nov 19, 2019 · 0 comments
Open
1 task done

Frontmatter Parsing Failure Does Not Report Filename #2029

bliles opened this issue Nov 19, 2019 · 0 comments
Labels
contribution welcome Contributions welcome type: bug Something isn't working

Comments

@bliles
Copy link

bliles commented Nov 19, 2019

  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

  • Create a file with frontmatter that cannot be properly parsed, for example, add an extra colon to an unquoted title attribute in yaml frontmatter
  • Run vuepress build
  • The frontmatter parser will report the problem with the content, but no indication of which file has the problem.

What is expected?

The error report should include the filepath of the file with the problem.

What is actually happening?

The error report only includes a sometime vague description of the problem, but not which file has the problem. Our vuepress site is being translated into several languages, the translators do not always format the frontmatter properly, and it is very time consuming to determine which file contains the bad frontmatter.

Other relevant information

It seems like the simplest option would be a try catch in core/lib/node/Page.js:process since in this function we know the filepath, I can open a PR if you like.

  • Output of npx vuepress info in my VuePress project:
$ npx vuepress info

Environment Info:

  System:
    OS: Linux 5.3 Pop!_OS 19.10
    CPU: (6) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
  Binaries:
    Node: 10.17.0 - ~/.nvm/versions/node/v10.17.0/bin/node
    Yarn: Not Found
    npm: 6.11.3 - ~/.nvm/versions/node/v10.17.0/bin/npm
  Browsers:
    Chrome: 78.0.3904.108
    Firefox: 70.0.1
  npmPackages:
    @vuepress/core:  1.0.1 
    @vuepress/theme-default:  1.0.1 
    vuepress: ^1.0.0-beta.2 => 1.0.1 
  npmGlobalPackages:
    vuepress: 1.2.0
@kefranabg kefranabg added the type: bug Something isn't working label Nov 22, 2019
@billyyyyy3320 billyyyyy3320 added the contribution welcome Contributions welcome label Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Contributions welcome type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants