The issue was that gatsby-plugin-mdx implements onPreBootstrap, which overrides oembed's onPreBootstrap implementation. This meant that when we tried to change embed nodes, we couldn't find any providers so all nodes got ignored.
I moved onPreBootstrap code to a separate helper and call it the same way as before. This means behavior when used with Remark should be unchanged.
However, when we try to use the list of providers, we now re-fetch it and update cache if it isn't yet available in cache. This makes the plugin work with MDX.
This fixes #66
The issue was that
gatsby-plugin-mdx
implementsonPreBootstrap
, which overrides oembed's onPreBootstrap implementation. This meant that when we tried to change embed nodes, we couldn't find any providers so all nodes got ignored.I moved
onPreBootstrap
code to a separate helper and call it the same way as before. This means behavior when used with Remark should be unchanged.However, when we try to use the list of providers, we now re-fetch it and update cache if it isn't yet available in cache. This makes the plugin work with MDX.
Here's an example repository with 1 post where using
gatsby-remark-oembed
worked with mdx: https://github.com/Swizec/swizec-blog/tree/oembed-playground