Skip to content

npm run dev crashes hard on syntax error in front matter #2813

Open
@KajKandler

Description

@KajKandler

Environment


  • Operating System: Darwin
  • Node Version: v21.7.1
  • Nuxt Version: 3.13.2
  • CLI Version: 3.14.0
  • Nitro Version: 2.9.7
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Create a markdown file with front matter, and indent the front matter incorrectly

Describe the bug

When I have a syntax error in the front matter of a page, the run dev crashes and needs to be restarted

Additional context

Using NUXT/content and NUXTJS/seo

Logs

  12 |    - mainEntity:
  ---------^
  13 |      '@type': "Person"
  14 |      '@id': "https://coldframe.ent ...
  at generateError (node_modules/js-yaml/dist/js-yaml.mjs:1273:10)
  at throwError (node_modules/js-yaml/dist/js-yaml.mjs:1277:9)
  at readBlockSequence (node_modules/js-yaml/dist/js-yaml.mjs:2105:7)
  at composeNode (node_modules/js-yaml/dist/js-yaml.mjs:2530:12)
  at readBlockMapping (node_modules/js-yaml/dist/js-yaml.mjs:2254:11)
  at composeNode (node_modules/js-yaml/dist/js-yaml.mjs:2531:12)
  at readDocument (node_modules/js-yaml/dist/js-yaml.mjs:2715:3)
  at loadDocuments (node_modules/js-yaml/dist/js-yaml.mjs:2778:5)
  at Object.load$1 [as load] (node_modules/js-yaml/dist/js-yaml.mjs:2804:19)
  at parseFrontMatter (node_modules/remark-mdc/dist/index.mjs:46:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions