You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this new call here to mdx.createCompiler(compilerOptions) from #25437, which I'm now picking up when upgrading from gatsby-plugin-mdx 1.2.22 -> 1.2.25 (3 patches), is suddenly causing my build to fail because mdx.createCompiler is not a function:
> docz-app@ build /dds/docs/.docz
> gatsby build "--prefix-paths"
warn Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
warn Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
success open and validate gatsby-configs - 1.366s
success load plugins - 1.152s
success onPreInit - 0.020s
success delete html and css files from previous builds - 0.012s
success initialize cache - 0.009s
success copy gatsby files - 0.135s
success onPreBootstrap - 0.408s
success createSchemaCustomization - 0.005s
ERROR #11321 PLUGIN
"gatsby-plugin-mdx" threw an error while running the onCreateNode lifecycle:
mdx.createCompiler is not a function
TypeError: mdx.createCompiler is not a function
- gen-mdx.js:236 findImports
[dds]/[gatsby-plugin-mdx]/utils/gen-mdx.js:236:24
- on-create-node.js:59 Object.module.exports [as onCreateNode]
[dds]/[gatsby-plugin-mdx]/gatsby/on-create-node.js:59:46
not finished source and transform nodes - 2.187s
Steps to reproduce
Use the plugin with peer dependency @mdx-js/mdx at 1.5.8 or less.
$ yarn build # will fail
$ yarn add @mds-js/mdx@1.5.9
$ yarn build # will succeed
Expected result
I did some digging and found this comes from @mdx-js/mdx in this PR mdx-js/mdx#1018 from April 21, 2020, which was picked-up in @mds-jx/mdx@1.5.9. You can see that by noting that:
We recently began using a new API in MDX with #25437 which
doesn't exist for all versions below 1.5.9. This updates the
peer dep for MDX to ensure that the new minimum version is
specified.
Fixes#25691
…25798)
We recently began using a new API in MDX with #25437 which
doesn't exist for all versions below 1.5.9. This updates the
peer dep for MDX to ensure that the new minimum version is
specified.
Fixes#25691
Description
So this new call here to
mdx.createCompiler(compilerOptions)
from #25437, which I'm now picking up when upgrading fromgatsby-plugin-mdx
1.2.22 -> 1.2.25 (3 patches), is suddenly causing my build to fail becausemdx.createCompiler
is not a function:Steps to reproduce
Use the plugin with peer dependency
@mdx-js/mdx
at 1.5.8 or less.https://github.com/stefcameron/gatsby-plugin-mdx-peer-repro
Expected result
I did some digging and found this comes from
@mdx-js/mdx
in this PR mdx-js/mdx#1018 from April 21, 2020, which was picked-up in@mds-jx/mdx@1.5.9
. You can see that by noting that:This means that, at the least, the peer dependency of
gatsby-plugin-mdx
on@mdx-js/mdx@^1.0.0
should have been bumped to^1.5.9
as of this change.Actual result
Production build (only) fails because
@mdx-js/mdx
peer was < 1.5.9.Environment
The text was updated successfully, but these errors were encountered: