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

remarkPluginFrontmatter is undefined after render #5859

Closed
1 task
fflaten opened this issue Jan 14, 2023 · 2 comments · Fixed by #5927
Closed
1 task

remarkPluginFrontmatter is undefined after render #5859

fflaten opened this issue Jan 14, 2023 · 2 comments · Fixed by #5927
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@fflaten
Copy link
Contributor

fflaten commented Jan 14, 2023

What version of astro are you using?

2.0.0-beta.2

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

When using content collections with Astro v2 beta, I'm unable to access frontmatter by a remark plugin.

const { remarkPluginFrontmatter } = await post.render();
/* remarkPluginFrontmatter is undefined */

With Astro v.1.9 this works fine when using injectedFrontmatter.
See blog.astro page in repro.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-a5wsjy

Participation

  • I am willing to submit a pull request for this issue.
@fflaten fflaten changed the title remarkPluginFrontmetter is undefined after render remarkPluginFrontmatter is undefined after render Jan 14, 2023
@bluwy bluwy added - P3: minor bug An edge case that only affects very specific usage (priority) content-collections labels Jan 16, 2023
@bluwy
Copy link
Member

bluwy commented Jan 16, 2023

Looks like this was changed at #5687

remarkPluginFrontmatter: mod.frontmatter,

But I can't seem to find where mod.frontmatter would originate from

@izmttk
Copy link
Contributor

izmttk commented Jan 21, 2023

@bluwy It seems to be because that the frontmatter property is not exported in the loader of vite-plugin-content-assets.

export { Content, getHeadings } from ${JSON.stringify(basePath)};

@bholmesdev bholmesdev added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed - P3: minor bug An edge case that only affects very specific usage (priority) labels Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants