estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.85k stars 69 forks source link

Issue: YAMLParseError in beta V10.1.8599652 #794

Closed Digital-Grinnell closed 2 months ago

Digital-Grinnell commented 2 months ago

Describe the bug I was running the beta version and upon update to v10.1.8599652 I started getting "YAMLParseError" messages whenever I opened or had my scripts process any .md with a leading "---" YAML frontmatter marker. Removing the "---" did remove the error, but naturally broke my Markdown.

To Reproduce

  1. Enable beta v10.1.8599652
  2. Open any .md file with YAML frontmatter and an opening '---' line
  3. See the error

Expected behavior A '---' opening line before the YAML frontmatter is normal and necessary. But if I remove it the syntax error goes away, but leaves my Markdown unuseable. Likewise, if I disable the beta version and switch to the production release (v10.0.2 in my case) the error is no longer present.

Desktop

Additional Context Note that I have a Python script run from a FM button and that script is also broken by this bug. The script parses each .md file in my content folder presumably in a similar manner as the VSCode editor does. With the beta version enabled the script no longer works, but it also returns no errors. After switching to the production version all is well again.

estruyf commented 2 months ago

Hi @Digital-Grinnell, thank you for opening the issue. Can you test out other BETA versions? The version you've mentioned only included an HTML class fix, and I can't seem to reproduce the issue. Looking for a clue why it would occur.

estruyf commented 2 months ago

Could you provide me with some sample content on which you have the issue?

Digital-Grinnell commented 2 months ago

Sure, it was happening on every piece of .md content in my site. The last one I edited was:


title: The Tama Co. Rifles date: 2024-04-10 slug: tama-rifles dateRange: Wed. April 10 shortTitle: Tama Co. Rifles oneSheet: /one-sheet-images/2024.04.10-Tama-County-Rifles-Wieting.png showType: Live Performance runningTime: 90 mpaaRating: Not Rated imdbURL: "" occurrences:

Let me know if you need more or sent differently.

Thanks, and take care.

-Mark M.

From: Elio Struyf @.> Date: Wednesday, April 10, 2024 at 10:22 AM To: estruyf/vscode-front-matter @.> Cc: Digital @.>, Mention @.> Subject: Re: [estruyf/vscode-front-matter] Issue: YAMLParseError in beta V10.1.8599652 (Issue #794) Caution: External Email

Could you provide me with some sample content on which you have the issue?

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_estruyf_vscode-2Dfront-2Dmatter_issues_794-23issuecomment-2D2047845035&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=vMn2TxvBZxDLKaDM9ypH5XSInDkPOm1KT20o3UWTX4C0EomOcDIryg6PoRJRJsDZ&s=w-leOMkL4WQ5NBjJ-NDsKPmWHf1CLJ62S3RVkt3y9rM&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADTEQ6AUUA5JLEVKDV6YPWLY4VKKJAVCNFSM6AAAAABGAUKYYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXHA2DKMBTGU&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=vMn2TxvBZxDLKaDM9ypH5XSInDkPOm1KT20o3UWTX4C0EomOcDIryg6PoRJRJsDZ&s=mxWBU0xUl02eqMXZ-W1i01C4sMrKC_0pbj22oW2Pbb0&e=. You are receiving this because you were mentioned.Message ID: @.***> This email was sent from outside Grinnell College. Treat attachments and links with caution. If this message looks suspicious, use the report phish button.

davidsneighbour commented 2 months ago

Do you maybe have the YAML extension installed? I am also experiencing weird YAML errors, but in other files (for instance, template files), where the YAML parser cites frontmatter issues in a content file (not the current file loaded). Going into that content file and then saving it silences the error for a bit, until it finds another content file to complain about.

I thought this might be a YAML plugin issue, not a Frontmatter plugin issue.

Latest Beta version, also for the past two days.

estruyf commented 2 months ago

I found the issue. It was an experiment for #792, but as it was still in testing, I have reverted that change. The new beta should fix it.

Digital-Grinnell commented 2 months ago

I don’t believe I have any YAML extension loaded, at least none came up when I checked my installed extensions list. When I removed the FM extension the problem went away, and did not return when I replaced the beta with the production release.

From: Patrick Kollitsch @.> Date: Wednesday, April 10, 2024 at 10:53 AM To: estruyf/vscode-front-matter @.> Cc: Digital @.>, Mention @.> Subject: Re: [estruyf/vscode-front-matter] Issue: YAMLParseError in beta V10.1.8599652 (Issue #794) Caution: External Email

Do you maybe have the YAML extensionhttps://urldefense.proofpoint.com/v2/url?u=https-3A__marketplace.visualstudio.com_items-3FitemName-3Dredhat.vscode-2Dyaml&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=6LbsCiXMOLlh4VSWPuSdg3D7cI3dKMGrmXfb5wfxsKwEAbfC3SOgiVUIPScyTtZb&s=_r8pNxU16TwLh_DPoxIhzv48dVZ209FiW4vUpnlpayM&e= installed? I am also experiencing weird YAML errors, but in other files (for instance, template files), where the YAML parser cites frontmatter issues in a content file (not the current file loaded). Going into that content file and then saving it silences the error for a bit, until it finds another content file to complain about.

I thought this might be a YAML plugin issue, not a frontmatter issue.

Latest Beta version, also for the past two days.

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_estruyf_vscode-2Dfront-2Dmatter_issues_794-23issuecomment-2D2047914951&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=6LbsCiXMOLlh4VSWPuSdg3D7cI3dKMGrmXfb5wfxsKwEAbfC3SOgiVUIPScyTtZb&s=n2en_CvPiqSME0Lku4X2nH_kxkZN4cjfZUnX1FXneSI&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADTEQ6EJPBTSU4J7DQRZMBLY4VN6HAVCNFSM6AAAAABGAUKYYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXHEYTIOJVGE&d=DwMFaQ&c=HUrdOLg_tCr0UMeDjWLBOM9lLDRpsndbROGxEKQRFzk&r=D8E-oGNaPT9srWV6jE8UP5unsmKEmmHEH-tzgmjBvLk&m=6LbsCiXMOLlh4VSWPuSdg3D7cI3dKMGrmXfb5wfxsKwEAbfC3SOgiVUIPScyTtZb&s=SxfjMa5F5beyLO-BOoee7nn7DoFKbw2b60XAX_t-h8I&e=. You are receiving this because you were mentioned.Message ID: @.***> This email was sent from outside Grinnell College. Treat attachments and links with caution. If this message looks suspicious, use the report phish button.

davidsneighbour commented 2 months ago

I found the issue. It was an experiment for #792, but as it was still in testing, I have reverted that change. The new beta should fix it.

My errors disappeared after this update.

estruyf commented 2 months ago

Thanks @davidsneighbour for verifying