Skip to content

Error: could not parse changeset - invalid frontmatter: --- #461

@nategreen

Description

@nategreen

Affected Packages

Looks like it's @changesets/parse?

Problem

When running changeset version locally, I get an error like:

�  error Error: could not parse changeset - invalid frontmatter: ---
�  error "@mri/components": patch
�  error "@mri/elements-common": patch
�  error "@mri/svg-icons": patch
�  error "@mri/bootstrap-theme": patch
�  error "@mri/scss-all": patch
�  error ---
�  error
�  error Several small changes for tooling or CI, related to transition from rush.js back to PNPM and changesets.
�  error
�  error     at parseChangesetFile (C:\dev\mri-design-system-3\node_modules\.pnpm\@changesets\parse@0.3.6\node_modules\@changesets\parse\dist\parse.cjs.dev.js:14:11)
�  error     at C:\dev\mri-design-system-3\node_modules\.pnpm\@changesets\read@0.4.6\node_modules\@changesets\read\dist\read.cjs.dev.js:89:30
�  error     at async Promise.all (index 0)
�  error     at async getChangesets (C:\dev\mri-design-system-3\node_modules\.pnpm\@changesets\read@0.4.6\node_modules\@changesets\read\dist\read.cjs.dev.js:93:48)
�  error     at async Promise.all (index 0)
�  error     at async version (C:\dev\mri-design-system-3\node_modules\.pnpm\@changesets\cli@2.10.3\node_modules\@changesets\cli\dist\cli.cjs.dev.js:454:34)
�  error     at async run$1 (C:\dev\mri-design-system-3\node_modules\.pnpm\@changesets\cli@2.10.3\node_modules\@changesets\cli\dist\cli.cjs.dev.js:1104:11)

I got this error when I had not edited the file whatsoever, and it had already been pushed up, handled successfully by changeset version in CI, etc. So it must be something on my local machine.

Looking at the regex parsing the front matter, it looks like it is matching only when there is whitespace before the first ---:

const mdRegex = /\s*---([^]*?)\n\s*---\n([^]*)/;

So I tried adding some whitespace...spaces, newlines, whatever...but nothing worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions