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 causes "Maximum call stack size exceeded" error on gatsby build #34846

Closed
2 tasks done
wltrallen2 opened this issue Feb 18, 2022 · 1 comment
Closed
2 tasks done
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@wltrallen2
Copy link

Preliminary Checks

Description

Using gatsby v.4.7.2, when adding gatsby-plugin-mdx 3.7.1 (or any other version for that matter), on running gatsby develop, the build fails with the following error:

  ModuleBuildError: Module build failed (from ./node_modules/gatsby/
  dist/utils/babel-loader.js):
  RangeError: /Users/waltermayallen/Sites/akinsCounseling/node_modul
  es/gatsby-plugin-mdx/gatsby-ssr.js: Maximum call stack size exceed
  ed

This occurs whether I install the mdx plugin from the gatsby new script or independently after I've already created the project.

Reproduction Link

https://github.com/wltrallen2/mdxErrorReproduction

Steps to Reproduce

  1. Run gatsby new
  2. Choose to install markdown/MDX - or - run gatsby-plugin-mdx after generating a new project
  3. Run gatsby build

Expected Result

The project builds.

Actual Result

The project build fails with

ModuleBuildError: Module build failed (from ./node_modules/gatsby/
  dist/utils/babel-loader.js):
  RangeError: /Users/waltermayallen/Sites/akinsCounseling/node_modul
  es/gatsby-plugin-mdx/gatsby-ssr.js: Maximum call stack size exceed
  ed

Environment

System:
    OS: macOS 11.6.2
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.24.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 98.0.4758.102
    Firefox: 92.0
    Safari: 15.1
  npmPackages:
    gatsby: ^4.7.2 => 4.7.2
    gatsby-plugin-image: ^2.7.0 => 2.7.0
    gatsby-plugin-mdx: ^3.7.1 => 3.7.1
    gatsby-plugin-sharp: ^4.7.0 => 4.7.0
    gatsby-source-filesystem: ^4.7.0 => 4.7.0
  npmGlobalPackages:
    gatsby-cli: 4.7.0

Config Flags

NO

@wltrallen2 wltrallen2 added the type: bug An issue or pull request relating to a bug in Gatsby label Feb 18, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 18, 2022
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 18, 2022
@LekoArts
Copy link
Contributor

Hi! This was an intermittent upstream issue that is fixed now: #34823

Your lock file still has

"node_modules/@babel/core": {
      "version": "7.17.3",
      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.3.tgz",

So delete it and re-install again and it'll work as 7.17.4 will get installed.

Both gatsby new and just installing the plugin don't have a lock file or pinned version to this, so I'm not sure how you installed this faulty version and not the latest.

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

No branches or pull requests

2 participants