Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdx: plugin.resolve doesn't actually resolve anymore; throws error on build #33500

Closed
2 tasks done
davwheat opened this issue Oct 12, 2021 · 2 comments
Closed
2 tasks done
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@davwheat
Copy link
Contributor

Preliminary Checks

Description

During the patches for Gatsby v4, it seems that plugin.resolve has stopped being resolved to a module in the MDX plugin.

https://github.com/gatsbyjs/gatsby/blame/58d30fd9a5d85a31a29a404ce01b74fb5e7dbb7b/packages/gatsby-plugin-mdx/gatsby/create-schema-customization.js#L76-L77

Previous to #33170, plugin.resolve used to get required inside the MDX plugin. If this has been deprecated, it wasn't mentioned anywhere, and should be added to the v4 upgrade guide,

I don't think this is intentional, as it also breaks the short-hand plugin syntax where we only give the plugin name as a string, rather than a JS object.

Reproduction Link

https://github.com/davwheat/gatsby-issue-reproduction-1

Steps to Reproduce

  1. Add gatsbyPlugins to MDX config
  2. Use { resolve: 'my-plugin-name' } or 'my-plugin-name'
  3. Attempt build

Expected Result

Site should build with plugins used

Actual Result

Build fails as plugin.module is undefined and not resolved from plugin.resolve.

Environment

System:
    OS: Windows 10 10.0.22471
    CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
  Binaries:
    Node: 15.1.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 7.6.1 - ~\AppData\Roaming\npm\npm.CMD
  Languages:
    Python: 3.10.0 - /c/Python310/python
  Browsers:
    Edge: Spartan (44.22471.1000.0), Chromium (94.0.992.38)
  npmGlobalPackages:
    gatsby-cli: 3.7.1

Config Flags

No response

@davwheat davwheat added the type: bug An issue or pull request relating to a bug in Gatsby label Oct 12, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 12, 2021
@pieh
Copy link
Contributor

pieh commented Oct 12, 2021

Your reproduction is using gatsby@3 (at least to package-lock.json) with mdx package for gatsby@4. You need to either upgrade gatsby or "downgrade" plugins to be compatible.

@LekoArts LekoArts added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Oct 12, 2021
@LekoArts
Copy link
Contributor

Hi!

Since we didn't receive an answer for 7 days or more about the ask of a reproduction I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or open a new issue with a reproduction. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants