-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-plugin-mdx] Frontmatter shows up in page content #35901
Comments
Hi @karlhorky We did merge the #35859 - the initial suggestion comments you made in the PR that introduced it made sense and we just used it. This was not release yet to npm. I couldn't really reproduce the part about the change not working in builds - I suspect this is because of webpack caching (if you edit files in
So to test changes like that inside I'm not sure if the change above is enough - this was targetted for webpack loader for now, but this is only usage of the |
Oh didn't see #35859 yet, thanks!! I'll be happy to test whether this fixes the issue without my patches when it is published to npm.
Yeah I was doing |
@karlhorky just released I did want to try the reproduction, but link seems borked. Tried using github.com ( https://github.com/karlhorky/gatsby-mdx-frontmatter-bug ) but repo like doesn't exist or is private |
Ah sorry, that repo is not there right now. But just upgraded to Passing our tests: And, no more Frontmatter content on the page: Closing this out. |
Preliminary Checks
Description
After upgrading from
[email protected]
to[email protected]
, we're seeing our Frontmatter code show up in the content of the page 😱This appears regardless of whether we have the
JSFrontmatterEngine
set totrue
or unconfigured...cc @pieh @GeeWizWow
Workaround
A solution for
gatsby build
(SSG) requires reverting the change made by @pieh in #35830:gray-matter
in themdx-loader.js
,utils/mdx.js
,utils/gen-mdx.js
files (usingpatch-package
)JSFrontmatterEngine
optionSuper strange, wonder what's causing this Frontmatter to show up in the content.
Reproduction Link
https//.com/karlhorky/gatsby-mdx-frontmatter-bug
Steps to Reproduce
[email protected]
to[email protected]
gatsby develop
orgatsby build
Expected Result
No Frontmatter in the page content
Actual Result
Frontmatter displayed in the page content
Environment
System: OS: macOS 12.4 CPU: (8) arm64 Apple M1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.11.0 - /var/folders/sw/v93sywxs2g1bcsr6ln488qfh0000gn/T/yarn--1654793941511-0.7489250249814705/node Yarn: 1.22.19 - /var/folders/sw/v93sywxs2g1bcsr6ln488qfh0000gn/T/yarn--1654793941511-0.7489250249814705/yarn npm: 8.7.0 - ~/.nvm/versions/node/v16.11.0/bin/npm Browsers: Chrome: 102.0.5005.61 Firefox: 99.0.1 Safari: 15.5
Config Flags
No response
The text was updated successfully, but these errors were encountered: