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.

gatsby-plugin-mdx doesn't find local plugins?

See original GitHub issue

Is this expected? Known issue?

{
  resolve: `gatsby-plugin-mdx`,
  options: {
    gatsbyRemarkPlugins: [
      `my-local-plugin`, // doesn't work
      {
        resolve: require.resolve('path-to-my-local-plugin') // works
      }
    ]
  }
}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
piehcommented, Apr 20, 2020

There are lots of interconnected issues here. Especially if the gatsby-plugin-mdx is declared in theme and not in top-level gatsby-config:

Note that the issues mostly talk about subplugins being npm packages, but it’s actually the same problem for local plugins

Exporting resolvePlugin alone wouldn’t be enough - there would also need to be some metadata of location of gatsby-config that declare given plugin to be able to resolve correctly (to use as rootDir param of `resolvePlugin).

On top of that, check this comment https://github.com/gatsbyjs/gatsby/pull/8379#issuecomment-585223189 about work on “selective cache invalidation” - for this to work Gatsby core will need to know about relationships between plugins/subplugins to properly clear caches and exporting resolvePlugin will “hide” this information from core, meaning that “selective cache invalidation” won’t have enough information to work properly.

0reactions
piehcommented, Apr 21, 2020

I’ll close this issue, because the problem is already captured in https://github.com/gatsbyjs/gatsby/issues/21592 and there’s no point in having duplicates.

The resolvePlugin option is also already mention there (as well as some limitation of this approach)

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-plugin-mdx
gatsby -plugin-mdx requires gatsby-source-filesystem to be present and configured to process local MDX files in order to generate the resulting Gatsby nodes ...
Read more >
gatsby-plugin-mdx cannot find module 'gatsby/webpack'
I'm pretty new to gatsby, and most of the plugins added were from following their tutorials, so I'm really scratching my head here....
Read more >
How to create a blog in Gatsby with MDX | by Brion Mario
In this post, I will go through the process of configuring a Gatsby application to be able to list out a blog index...
Read more >
gatsby-plugin-mdx v4.3.0
Gatsby remark plugins. This config option is used for compatibility with a set of plugins many people use with remark that require the...
Read more >
GatsbyJS - Transform Data to Use MDX - codersnack.com
To see a list of other transformer plugins, try searching for gatsby-transformer- in the Gatsby Plugin Library.
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