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

gatsby-remark-responsive-iframe not working after updating mdx to latest build. #553

Closed
GerardKetuma opened this issue Apr 23, 2019 · 3 comments

Comments

@GerardKetuma
Copy link

gatsby-remark-responsive-iframe not working due to mdx.

After updating mdx and it's related packages (mdx - ^1.0.0, tag - ^0.20.3, react - ^1.0.6) and also updating gatsby - ^2.3.37 to the lastest build, iframes in mdx files are no longer being transformed to be responsive.

Environment

  • MacOS Mojave
  • mdx - ^1.0.0, tag - ^0.20.3, react - ^1.0.6, gatsby - ^2.3.37
  • npm - 6.9.0, node 10.

Steps to reproduce

I have created a minimal repo which is a clone of the gatsby-starter-blog here:
https://github.com/GerardKetuma/gatsby-mdx-blog

Run it (npm start) and go to this path: /hi-folks/

I added a sample youtube iframe embed in that page and you will see that it does nothing even though gatsby-remark-responsive-iframe is configured.

Expected behaviour

The iframe is supposed to be responsive within the aspect ratio defined by the width and height.

Actual behaviour

The iframe is displayed as is.

@ChristopherBiscardi had mentioned to update the packages as there was a fix to the repo, which I did (#429 (comment))

@ChristopherBiscardi
Copy link
Member

Note that @mdx-js/tag is no longer required if you're using mdx-js/mdx and mdx-js/react 1.0 and gatsby-mdx 0.6.x. you should remove that package from your site.

@GerardKetuma
Copy link
Author

@ChristopherBiscardi Removed mdx-js/tag from the minimal repo to reproduce the issue.

@johno
Copy link
Member

johno commented May 7, 2019

Thanks for the report @GerardKetuma! I've opened up a PR in the Gatsby repo to update gatsby-remark-responsive-iframe to better support MDX's slightly different AST. You can follow along there to see when the fix is published.

@johno johno closed this as completed May 7, 2019
johno added a commit to johno/gatsby that referenced this issue May 8, 2019
In MDX the nodes that need to be visited are labeled as JSX so this
includes that node type in addition to HTML.

Related:

- mdx-js/mdx#553
- gatsbyjs#13552
freiksenet pushed a commit to gatsbyjs/gatsby that referenced this issue Jun 24, 2019
…es (#13913)

In MDX the nodes that need to be visited are labeled as JSX so this
includes that node type in addition to HTML.

Related:

- mdx-js/mdx#553
- #13552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants