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

[gatsby-plugin-mdx] + [gatsby-recipes]: Mixed mdx versions (2.x alpha being pulled in) #27278

Closed
tony opened this issue Oct 4, 2020 · 5 comments · Fixed by #27057
Closed
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@tony
Copy link

tony commented Oct 4, 2020

Description

This is leading to hard-to-trace issues since:

Pinning were originally changed in 07085fa / #24595

Steps to reproduce

This can end up installing both mdx 2.0.0 and 1.6.6 simultaneously, causing hard to trace issues in projects since its picked up implicitly

Expected result

What should happen?

Actual result

Mixed versions of mdx being installed

"@mdx-js/mdx@^2.0.0-next.4", "@mdx-js/mdx@^2.0.0-next.7":                                                                                                                                                                                      version "2.0.0-next.7"                                                                                                                                                                                                                       resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-2.0.0-next.7.tgz#3f27449e6a78ac0a9cc682f98e1c93442e93f166"                                                                                                                          integrity sha512-GcdHQ+YTlIaNpsMPlw32kEp+GCrb+2GLeDDf2AFtJiRoTelgCinjYp1twxY42WF6A4K80ZYgpr0/A6PDQbKNyw==                                                                                                                                    dependencies:                                                                                                                                                                                                                                  "@babel/core" "7.10.5"                                                                                                                                                                                                                       "@babel/plugin-syntax-jsx" "7.10.4"                                                                                                                                                                                                          "@babel/plugin-syntax-object-rest-spread" "7.8.3"
    "@mdx-js/util" "^2.0.0-next.7"                                                                                                                                                                                                               babel-plugin-apply-mdx-type-prop "^2.0.0-next.7"
    babel-plugin-extract-export-names "^2.0.0-next.7"                                                                                                                                                                                            babel-plugin-extract-import-names "^2.0.0-next.7"                                                                                                                                                                                            camelcase-css "2.0.1"                                                                                                                                                                                                                        detab "2.0.3"                                                                                                                                                                                                                                hast-to-hyperscript "9.0.0"                                                                                                                                                                                                                  hast-util-raw "6.0.0"                                                                                                                                                                                                                        lodash.uniq "4.5.0"                                                                                                                                                                                                                          mdast-util-to-hast "9.1.0"                                                                                                                                                                                                                   remark-footnotes "1.0.0"                                                                                                                                                                                                                     remark-mdx "^2.0.0-next.7"                                                                                                                                                                                                                   remark-mdxjs "^2.0.0-next.7"                                                                                                                                                                                                                 remark-parse "8.0.2"                                                                                                                                                                                                                         remark-squeeze-paragraphs "4.0.0"                                                                                                                                                                                                            unified "9.0.0"                                                                                                                                                                                                                              unist-builder "2.0.3"                                                                                                                                                                                                                        unist-util-visit "2.0.3"                                                                                                                                                                                                                                                                                                                                                                                                                                                              "@mdx-js/react@<1.6.17", "@mdx-js/react@^1.5.2":                                                                                                                                                                                               version "1.6.16"                                                                                                                                                                                                                             resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.16.tgz#538eb14473194d0b3c54020cb230e426174315cd"                                                                                                                            integrity sha512-+FhuSVOPo7+4fZaRwWuCSRUcZkJOkZu0rfAbBKvoCg1LWb1Td8Vzi0DTLORdSvgWNbU6+EL40HIgwTOs00x2Jw==                                                                                                                                                                                                                                                                                                                                                                               "@mdx-js/react@^2.0.0-next.4", "@mdx-js/react@^2.0.0-next.7":                                                                                                                                                                                  version "2.0.0-next.7"                                                                                                                                                                                                                       resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-2.0.0-next.7.tgz#33d3a2a961d5f2ebf36d096642c2a306111feae4"                                                                                                                      integrity sha512-VugV3o0zOD6pABtQEDDWNxiU8f+tS4KMiOgnwNiyxxOEwEZgBnXfMhZYDtHfrnhHxS59ValJ5zITnbdBwPbJkA==                                                                                                                                                                                                                                                                                                                                                                               "@mdx-js/runtime@^2.0.0-next.4":                                                                                                                                                                                                               version "2.0.0-next.7"                                                                                                                                                                                                                       resolved "https://registry.yarnpkg.com/@mdx-js/runtime/-/runtime-2.0.0-next.7.tgz#6efd063bc9bec85a16e38fddab02d12812c05d43"                                                                                                                  integrity sha512-+Nnjjs1LsdxkkdLODnFE0gz0B69uYJ+eUxScUBDoOY61jnm1NTvq/Axu3/Ax4YMtNwVCQMqBXXeOgLBDku1ISg==
  dependencies:
    "@mdx-js/mdx" "^2.0.0-next.7"
    "@mdx-js/react" "^2.0.0-next.7"
    buble-jsx-only "^0.19.8"

"@mdx-js/util@1.6.16":
  version "1.6.16"
  resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.16.tgz#07a7342f6b61ea1ecbfb31e6e23bf7a8c79b9b57"
  integrity sha512-SFtLGIGZummuyMDPRL5KdmpgI8U19Ble28UjEWihPjGxF1Lgj8aDjLWY8KiaUy9eqb9CKiVCqEIrK9jbnANfkw==

"@mdx-js/util@^2.0.0-next.7":
  version "2.0.0-next.7"
  resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-2.0.0-next.7.tgz#b1c52e7622917d7601b2c9ba2f132aaf8d4224fc"
  integrity sha512-gsid2rh63B7/U1gPLXz9N5bfWR+n5GYxAcVCJDf8H+XfCC7NHsEX9ZHL9IdmXndOPT4ZTSW6V/jD8VeQdvnzLQ==

gatsby-recipes@0.2.29:                                                                                                                                                                                                                         version "0.2.29"                                                                                                                                                                                                                             resolved "https://registry.yarnpkg.com/gatsby-recipes/-/gatsby-recipes-0.2.29.tgz#2720979bd81043269c286426f9ee7e3df17990a4"                                                                                                                  integrity sha512-E911POunZLlCwdJ2t7UrVveTNiIM2fZpDQ6pe4ufCaYmgWzdfEOWC24NIIuxA1DxMef748N71Ri8emU91k9aYg==                                                                                                                                    dependencies:                                                                                                                                                                                                                                  "@babel/core" "^7.11.6"                                                                                                                                                                                                                      "@babel/generator" "^7.11.6"                                                                                                                                                                                                                 "@babel/helper-plugin-utils" "^7.10.4"                                                                                                                                                                                                       "@babel/plugin-proposal-optional-chaining" "^7.11.0"                                                                                                                                                                                         "@babel/plugin-transform-react-jsx" "^7.10.4"                                                                                                                                                                                                "@babel/standalone" "^7.11.6"                                                                                                                                                                                                                "@babel/template" "^7.10.4"                                                                                                                                                                                                                  "@babel/types" "^7.11.5"                                                                                                                                                                                                                     "@emotion/core" "^10.0.14"                                                                                                                                                                                                                   "@emotion/styled" "^10.0.14"                                                                                                                                                                                                                 "@graphql-tools/schema" "^6.0.14"                                                                                                                                                                                                            "@graphql-tools/utils" "^6.0.14"                                                                                                                                                                                                             "@hapi/hoek" "8.x.x"                                                                                                                                                                                                                         "@hapi/joi" "^15.1.1"                                                                                                                                                                                                                        "@mdx-js/mdx" "^2.0.0-next.4"                                                                                                                                                                                                                "@mdx-js/react" "^2.0.0-next.4"                                                                                                                                                                                                              "@mdx-js/runtime" "^2.0.0-next.4"
    acorn "^7.2.0"                      
gatsby-site on  master [!] ❯ cat node_modules/@mdx-js/runtime/package.json
{
  "name": "@mdx-js/runtime",
  "version": "2.0.0-next.7",
  "description": "Parse and render MDX in a runtime environment",
  "repository": "mdx-js/mdx",
  "homepage": "https://mdxjs.com",
  "bugs": "https://github.com/mdx-js/mdx/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "John Otander <johnotander@gmail.com> (http://johnotander.com)",
  "contributors": [
    "John Otander <johnotander@gmail.com> (http://johnotander.com)",
    "Tim Neutkens <tim@vercel.com>",
    "Matija Marohnić <matija.marohnic@gmail.com>",
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
    "JounQin <admin@1stg.me> (https://www.1stg.me)",
    "Christian Murphy <christian.murphy.42@gmail.com>"
  ],

Environment

Run gatsby info --clipboard in your project directory and paste the output here.

master [!] ❯ gatsby info --clipboard

  System:
    OS: Linux 4.19 Ubuntu 20.04.1 LTS (Focal Fossa)
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.18.4 - /usr/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.6 - /usr/bin/npm
@tony tony added the type: bug An issue or pull request relating to a bug in Gatsby label Oct 4, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 4, 2020
@tony
Copy link
Author

tony commented Oct 4, 2020

I'm tracing an on/off mdx issue over a few weeks - it presents itself between package locks with yarn v1.

@KyleAMathews helped us switch gatsby-recipes to mdx v2 in #24595.

I'm having an issue where I'm getting mdx v2-next packages mixed into my lockfile (alongside 1.6.x pinned by me and gatsby-plugin-mdx) and wondering if that could causing hard-to-trace mdx issues.

I believe it is coming from gatsby-recipes. Is there any way you think gatsby-plugin-mdx and gatsby-recipes could cause an issue with wanting separate versions of mdxjs?

P.S. If anyone else has bumped into a similar issue and can provide a reproducible test case please chime in!

@KyleAMathews
Copy link
Contributor

@pieh is working on a fix for this in #27058 & #27057

@tony
Copy link
Author

tony commented Oct 4, 2020

Thank you @KyleAMathews!

@pieh @KyleAMathews Any preference if I close this or keep it open for now?

@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 5, 2020
@pieh
Copy link
Contributor

pieh commented Oct 5, 2020

@pieh @KyleAMathews Any preference if I close this or keep it open for now?

Let's keep this open until it's solved. I linked gatsby-recipes changes PR to this so it get's auto-closed once that is merged.

In the meantime, you can try those changes out by using gatsby@ink-compiled canary

@pieh
Copy link
Contributor

pieh commented Oct 26, 2020

Updates ( #27057 and #27058) were released:

  • gatsby-cli@2.12.113
  • gatsby-recipes@0.2.34
  • gatsby@2.24.87 ( this part You'd need to update)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants