-
Notifications
You must be signed in to change notification settings - Fork 25
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
Plugin does not work when configured as a gatsby-mdx gatsbyRemarkPlugin #66
Comments
Yes, it seems the plugin does not play nicely with I have not had time to look into it properly. There was some convo with the I think it might be an issue with It helps to know people would like this option, mixing Thank you so much for submitting an issue :D cc: @johno of |
Does not play well with anything I have tried it on basic gatsby starter or my site = does not work. |
@donaldboulton take a look at this repo, it is an example site I put together: https://github.com/raae/gatsby-remark-oembed-example-site. |
@wuz I have spoken to @ChristopherBiscardi on Twitter and he is looking into it. |
Hi @raae, any news about your plugin and mdx support? |
I'm having the same problem. (although it doesn't respect the "exclude" rule, and treat it like an include, indeed it load twitter script twice) On the other side when I include the plugin with PS: at the moment I found an extreme "workaround" that consist in including the plugin with |
Sorry I have not had time yet to look into mdx support. I have a little mdx experience. Things will slow down in a couple of weeks and I might get a chance to have a look. |
The problem was with me saving the providers to the gatsby cache on @Swizec solution is to check if the cache is set and if not fetch the providers. This leads to the providers being fetched a few times, but better than not working at all. I am working on moving to a mono repo and getting MDX into the example site before releasing a new version of the package. |
Found another issue, the code in gatsby-ssr and gatsby-browser will not be called when its a sub plugin of gatsby-plugin-mdx. There is a workaround, but I need to tweak the code a little so it's not to complicated to set up. |
Apologies for bumping up an old issue. Has this ever been fixed? |
No, there were some issues in gatsby-plugin-mdx that might have been resolved by now. It would be nice if someone could test it. |
This seems to be working locally for me now, will investigate further. |
MDX works! It would be great if someone could help add a note about this in the docs and also an example configuration and a new release will happen shortly, see #135. |
I have tried to run
https://gist.github.com/mono0x/3183e08da4ff23978da746a44f7d0b2f |
Hi @raae . It seems for MDX the issue is still there. As you mentioned Btw, is this project paused? Here's the workaround I mentioned above. Hope this can help those who still wants to use this plugin. My approach is to use it as local plugin. The plugin folder structure may look like this
Then re-export the hooks implemented by the plugin. // gatsby-broswer.js
const { onInitialClientRender, onRouteUpdate } = require("@raae/gatsby-remark-oembed/gatsby-node")
exports.onInitialClientRender = onInitialClientRender
exports.onRouteUpdate = onRouteUpdate
// gatsby-ssr.js
const { onRenderBody } = require("@raae/gatsby-remark-oembed/gatsby-node")
exports.onRenderBody = onRenderBody
// index.js
const gatsbyRemarkOembed = require("@raae/gatsby-remark-oembed")
const { onPreBootstrap } = require('@raae/gatsby-remark-oembed/gatsby-node')
exports.default = async (...args) => {
const { cache, reporter } = args[0]
await onPreBootstrap({ cache, reporter }, args[1])
return gatsbyRemarkOembed(...args)
} In your gatsby-configs.js, make sure to resolve the local plugin. (In my case, I have to use {
resolve: `gatsby-plugin-mdx`,
...,
gatsbyRemarkPlugins: [
...,
{
resolve: require.resolve(`./plugins/patched-@raae-gatsby-remark-oembed`),
options: {
usePrefix: ["oembed"],
providers: {
exclude: ["Redit"]
}
}
},
]
}
} |
It has kind of been paused, but I have plans to revive it after easter. I am now much more skilled in Gatsby and plugins so will probably be a major rewrite 🤪 |
Support in the next branch, help test and discuss #159 |
Hi there! I'm trying to use this plugin with Gatsby and MDX, but I can't seem to make it work. I've got it listed in the
gatsby-mdx
gatsbyRemarkPlugins
config, which has worked for other Remark plugins, but can't seem to find twitter links in my page. I'm not sure if where the problem is, but I don't see any errors.Here is my config for
gatsby-mdx
:and here is the output from this plugin:
The post looks like this:
Thanks so much for making this plugin! I hope I can get it working 😄
The text was updated successfully, but these errors were encountered: