Skip to content

Build Error: gatsby-plugin-mdx Not Compatible with Gatsby v5 #7006

@naikmubashir

Description

@naikmubashir

Description

The build is failing due to incompatibility between gatsby-plugin-mdx@3.20.0 and gatsby@5.15.0. The plugin requires Gatsby v4 and uses deprecated APIs, causing errors during the build process.
See job logs: https://github.com/layer5io/layer5/actions/runs/18346471007/job/52254360824?pr=6989

Expected Behavior

The build should complete successfully with compatible versions of Gatsby and gatsby-plugin-mdx.

Steps to Reproduce

  1. Run the site build with the current dependencies.
  2. Observe the error messages about plugin incompatibility and unknown APIs.

Proposed Solution

  • Upgrade gatsby-plugin-mdx to a version compatible with Gatsby v5 (e.g., ^5.0.0).
  • Remove or update any deprecated options (mdxOptions) in gatsby-config.js.
  • If used, rename any usage of unstable_shouldOnCreateNode to shouldOnCreateNode in custom plugins.
  • For SVG images, replace childImageSharp queries with publicURL as needed.

Screenshots

N/A

Environment:

  • Host OS:
  • Browser:

References:

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions