Skip to content

updated to gatsby v4 and now mdx image variables renders as text instead of a path #114

Description

@AlexanderThiele

Summary

Hello!
thanks for this lib! I recently updated gatsby to the latest version "gatsby": "^4.2.0" and also your lib to the latest version.

I'm currently testing and my images don't really seem to work anymore. Here is what i do:

inside the MDX file i import the image and use it as the src of an img.

import abc from '../../src/assets/linkfive/some/image.png'

...

<img src={abc} />

When i check the console, the html is rendered like this: <img src="{abc}" />

The strange part is that if i change the src tag to anything else, it works. For example like this:

import abc from '../../src/assets/linkfive/some/image.png'

...

<img rc={abc} />

Then the rendered HTML looks like this:

<img rc="/6b99b4641c4bf8b9f98bfe968de14325.png">

which is the correct png path.

i actually don't know that to do anymore. do you have any ideas?

Relevant information

Another thing i found during develop launch

warn Plugin `@rocketseat/gatsby-theme-docs-core` has customized the GraphQL type `MdxFrontmatter`, which has already been
defined by the plugin `gatsby-plugin-mdx`. This could potentially cause conflicts.

i checked the yarn.lock file and your lib is the only dependency of gatsby-plugin-mdx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions