question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MDX v2 breaks Markdown images with gatsby-remark-images

See original GitHub issue

Description

Attempting to upgrade to the latest version of MDX (2.0.0-next.7) breaks gatsby-remark-images.

Steps to reproduce

Minimal reproduction: https://github.com/patrickarlt/gatsby-mdx-v2-image-issue-reproduction

  1. Clone Repo
  2. npm install
  3. gatsby develop - note the missing image
  4. npm install @mdx-js/mdx@1.6.16 @mdx-js/react@1.6.16 - install previous mdx
  5. gatsby clean
  6. gatsby develop - image appears

Expected result

These pages should render the same in both MDX 2.0.0-next.7 and 1.16.6. This isn’t rendering the image in MDX 2.0.0-next.7

import { Link } from "gatsby";

# Image issues

![Test](../images/gatsby-astronaut.png)

<Link to="/page/">Second Page</Link>

2020-08-27_11-01-42

Actual result

Image does not render.

2020-08-27_10-58-12

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v12.16.3/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.16.3/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 84.0.4147.135
    Firefox: 81.0
    Safari: 13.1.2
  npmPackages:
    gatsby: ^2.24.12 => 2.24.12
    gatsby-image: ^2.4.16 => 2.4.16
    gatsby-plugin-manifest: ^2.2.4 => 2.2.4
    gatsby-plugin-mdx: ^1.0.0 => 1.0.22
    gatsby-plugin-offline: ^2.2.4 => 2.2.4
    gatsby-plugin-react-helmet: ^3.1.3 => 3.1.3
    gatsby-plugin-sharp: ^2.6.29 => 2.6.29
    gatsby-remark-images: ^3.3.27 => 3.3.27
    gatsby-source-filesystem: ^2.3.25 => 2.3.25
    gatsby-transformer-sharp: ^2.5.13 => 2.5.13
  npmGlobalPackages:
    gatsby-cli: 2.12.29

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
isaobushicommented, Sep 21, 2020

Any update on the matter ?

1reaction
jerelmillercommented, Mar 18, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

MDX v2 breaks Markdown images with gatsby-remark-images
Attempting to upgrade to the latest version of MDX (2.0.0-next.7) breaks gatsby-remark-images . Your environment. Using 2.0.0-next.
Read more >
Working with Images in Markdown & MDX - Gatsby
When building Gatsby sites composed primarily of markdown or MDX , insertion of images can enhance the content. ... Inline images with gatsby-remark-images....
Read more >
Trouble rendering images in markdown with gatsbyjs
From gatsby-remark-images plugin documentation: You can reference an image in markdown using the relative path, where that path is relative ...
Read more >
Learn Optimizing Images in MDX – Introduction to Gatsby, v2
Jason demonstrates how to optimize images in MDX automatically for standard Markdown-style images with gatsby-remark-images plugin, which helps avoid ...
Read more >
How to Build Blog Using Gatsby | by Suprabha Supi | Medium
MDX is way to enable React component inside of mark down. ... the image inline or in blog, you need to install one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found