Skip to content

v0.15.1: Error: Can't resolve '@mdx-js/react' in gatsby plugin #2330

@fwextensions

Description

@fwextensions

Describe the bug
Upgraded from 0.14.7 to 0.15.1, did a fresh install with npm i, and now running gatsby develop fails with an error:

Module not found: Error: Can't resolve '@mdx-js/react' in '...\node_modules\gatsby-plugin-theme-ui\src'

To Reproduce
Steps to reproduce the behavior:

Deps list in the package:

  "dependencies": {
    "@contentful/rich-text-types": "^15.13.2",
    "@fontsource/public-sans": "^4.5.10",
    "@lekoarts/gatsby-theme-styleguide": "^3.0.1",
    "@theme-ui/presets": "^0.15.1",
    "babel-plugin-styled-components": "^2.0.7",
    "dotenv": "^16.0.2",
    "gatsby": "^4.23.1",
    "gatsby-plugin-alias-imports": "^1.0.5",
    "gatsby-plugin-image": "^2.23.1",
    "gatsby-plugin-react-svg": "^3.1.0",
    "gatsby-plugin-styled-components": "^5.23.0",
    "gatsby-plugin-theme-ui": "^0.15.1",
    "gatsby-source-contentful": "^7.21.1",
    "gatsby-source-filesystem": "^4.23.0",
    "gatsby-transformer-sharp": "^4.23.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-helmet": "^6.1.0",
    "styled-components": "^5.3.5",
    "theme-ui": "^0.15.1"
  }

Expected behavior
My project is no longer using MDX, and I removed imports of Themed, so it's surprising to see @mdx-js being required.

Additional context
I see "@mdx-js/react": "^1" as a dev dependency in the plugin package, but maybe that should be a peer? Also if it is a dependency, seems strange that it's not getting installed by npm automatically.

I can manually add @mdx-js/react to package.json to get the gatsby build to work, but then I'm back to forcing the install because of React 18, which Theme-UI now requires but isn't supported by mdx v1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions