-
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
fix(gatsby-plugin-mdx): pass the correct options to setParserPlugins #18243
fix(gatsby-plugin-mdx): pass the correct options to setParserPlugins #18243
Conversation
Seems like this is pretty much copy & paste from remark plugin - gatsby/packages/gatsby-transformer-remark/src/extend-node-type.js Lines 128 to 142 in 68dbb6d
Which means if that's a bug we have it in both mdx and remark. Do you have any reproduction so we could verify this change quickly? |
Hi @pieh! I actually discovered this while debugging a remark plugin that worked with gatsby-transformer-remark but not gatsby-plugin-mdx, so I think the issue only exists with mdx. I can quickly make & share a reproduction repo in an hour or so |
@pieh I've just put this repro together: https://github.com/d4rekanguok/gatsby-bug-repro-18243 The step to reproduce is detailed in the readme. I think it might have something to do with the fact that remark plugins for mdx are passed in via options as |
Oh yeah, that would explain the difference. You are correct - |
Oh in that case, instead of fixing this like I did in this PR, maybe it's better to also handle This might be a really edge case however, since gatsby-plugin-mdx has been released for a long time & no one has yet filed a bug on this |
I think this is fine. Other subplugin API use mdx (using gatsby/packages/gatsby-plugin-mdx/utils/get-source-plugins-as-remark-plugins.js Lines 53 to 73 in b4e3c5e
remark (using gatsby/packages/gatsby-transformer-remark/src/extend-node-type.js Lines 216 to 235 in b4e3c5e
|
Co-Authored-By: Michal Piechowiak <misiek.piechowiak@gmail.com>
A few of my PRs is failing this unit_tests_node12:
I'm not submitting new starters though, so I'm not sure why it's failing... any ideas? @pieh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified fix. Works like a charm!
Huge thanks for reproduction making it much faster for us to merge this in!
Published |
Description
Hey folks!
In
gatsby-plugin-mdx
, whensetParserPlugins
is called, it was passed in the wrong options source:Instead of
plugin.pluginOptions
, it should have beenplugin.options
.Reproduction of bug
https://github.com/d4rekanguok/gatsby-bug-repro-18243