gatsby: gatsby-cli 2.6.12 error: RangeError: Maximum call stack size exceeded

Description

After using yarn upgrade and then yarn start, I now get an error RangeError: Maximum call stack size exceeded

I’ve seen a related issue with React Helmet, from my tests doesn’t seem to be related to this.

Steps to reproduce

yarn upgrade
yarn start

Expected result

No errors!

Actual result

/mnt/d/ee/hello-world/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

RangeError: Maximum call stack size exceeded
    at Array.values (<anonymous>)
    at Object.console.error (/mnt/d/ee/hello-world/node_modules/gatsby-cli/lib/reporter/index.js:216:50)
    at warningWithoutStack (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:100:32)
    at warnAboutUpdateOnUnmounted (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/mnt/d/ee/hello-world/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/mnt/d/ee/hello-world/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:132:10)
    at Object.error (/mnt/d/ee/hello-world/node_modules/gatsby-cli/lib/reporter/index.js:82:22)
    at Object.console.error (/mnt/d/ee/hello-world/node_modules/gatsby-cli/lib/reporter/index.js:216:39)
    at warningWithoutStack (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:100:32)
    at warnAboutUpdateOnUnmounted (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/mnt/d/ee/hello-world/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/mnt/d/ee/hello-world/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/mnt/d/ee/hello-world/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:132:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! pedrolamas.com@0.1.0 develop: `gatsby develop`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the pedrolamas.com@0.1.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pedro/.npm/_logs/2019-06-19T13_19_45_344Z-debug.log
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

Running on Windows 10 latest version via WSL!

  System:
    OS: Linux 4.4 Ubuntu 18.04.2 LTS (Bionic Beaver) -> Windows WSL
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Shell: 4.4.19 - /bin/bash
  Binaries:
    Node: 12.4.0 - /usr/bin/node
    Yarn: 1.16.0 - /usr/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Languages:
    Python: 2.7.15+ - /usr/bin/python
  npmPackages:
    gatsby: ^2.9.4 => 2.9.9
    gatsby-cli: ^2.6.12 => 2.6.12
    gatsby-image: ^2.1.4 => 2.1.4
    gatsby-mdx: ^0.6.3 => 0.6.3
    gatsby-plugin-eslint: ^2.0.5 => 2.0.5
    gatsby-plugin-manifest: ^2.1.1 => 2.1.1
    gatsby-plugin-offline: ^2.1.3 => 2.1.3
    gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12
    gatsby-plugin-sass: ^2.0.13 => 2.0.13
    gatsby-plugin-sharp: ^2.1.9 => 2.1.9
    gatsby-plugin-typescript: ^2.0.15 => 2.0.15
    gatsby-remark-images: ^3.0.16 => 3.0.16
    gatsby-source-filesystem: ^2.0.43 => 2.0.43
    gatsby-transformer-sharp: ^2.1.21 => 2.1.21
    gatsby-transformer-yaml: ^2.1.12 => 2.1.12
  npmGlobalPackages:
    gatsby-cli: 2.6.12

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 31 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I don’t think this issue should be closed since it breaks the Gatsby development experience from the get go. Using yarn work for me too.

I’m having the same outcome as @PedroLamas. But updating to the latest version or the versions proposed by @wardpeet gives me the same error after running gatsby develop.

Node: 10.12.0 NPM: 6.4.1

Package.json

"dependencies": {
    "classnames": "2.2.6",
    "gatsby": "2.10.4",
    "path": "0.12.7",
    "prismjs": "1.15.0",
    "react": "16.6.3",
    "react-dom": "16.6.3",
    "react-helmet": "5.2.0",
    "react-hubspot-form": "1.3.7",
    "react-scroll": "1.7.10",
    "swagger-ui": "3.22.0"
  },
  "devDependencies": {
    "@babel/core": "7.2.2",
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "23.6.0",
    "babel-preset-gatsby": "0.2.0",
    "gatsby-cli": "2.7.2",
    "gatsby-plugin-google-analytics": "2.1.0",
    "gatsby-plugin-manifest": "2.2.0",
    "gatsby-plugin-no-sourcemaps": "2.1.0",
    "gatsby-plugin-purgecss": "4.0.0",
    "gatsby-plugin-react-helmet": "3.1.0",
    "gatsby-plugin-robots-txt": "1.4.0",
    "gatsby-plugin-sass": "2.1.0",
    "gatsby-remark-autolink-headers": "2.1.0",
    "gatsby-remark-prismjs": "3.3.0",
    "gatsby-source-filesystem": "2.1.0",
    "gatsby-transformer-remark": "2.5.0",
    "identity-obj-proxy": "^3.0.0",
    "jest": "23.6.0",
    "node-sass": "4.12.0",
    "prettier": "1.15.3",
    "react-test-renderer": "16.7.0"
  }

Error:

/Users/user/project/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

RangeError: Maximum call stack size exceeded
    at Array.values (<anonymous>)
    at Object.format (util.js:73:10)
    at Console.console.error.args [as error] (/Users/user/project/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js:216:48)
    at warningWithoutStack (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:100:32)
    at warnAboutUpdateOnUnmounted (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/Users/user/project/node_modules/gatsby/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/Users/user/project/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:132:10)
    at Console.console.error.args [as error] (/Users/user/project/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js:216:39)
    at warningWithoutStack (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:100:32)
    at warnAboutUpdateOnUnmounted (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/Users/user/project/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/Users/user/project/node_modules/gatsby/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/Users/user/project/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:132:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR!docs@1.0.0 dev: `gatsby develop --open --host 0.0.0.0 --port 3000`
npm ERR! Exit status 7

Any idea?

Thank you. I’m just using “yarn upgrade” since yarn update is not available"

Interesting, using npm commands those packages still produce the error for me, but using yarn it all worked. Thanks!

Thanks so much for opening this issue! Tis should be fixed in version gatsby-cli@2.6.13 & gatsby@2.9.10. Sorry for the inconveniences.

If this is not the case, or if we can help further–please don’t hesitate to reach out or comment on this issue, and we’d love to take another look.

Thanks for using Gatsby 💪

To help us best begin debugging the underlying cause, it is incredibly helpful if you’re able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you’re up for it, we’d very much appreciate if you could provide a minimal reproduction and we’ll be able to take another look.

Thanks for using Gatsby! 💜

NPM USERS

It seems like npm isn’t installing peer dependencies correctly. You need to make sure react is at least on version 16.8.4 in your project.

For https://github.com/gyss/gatsby-starter, the package.json needs to change into

package.json
{
  "name": "gatsby-starter",
  "description": "Gatsby Starter",
  "version": "1.0.0",
  "author": "The starter",
  "main": "n/a",
  "scripts": {
    "start": "npm run clean && npm run dev",
    "dev": "gatsby develop --open --host 0.0.0.0 --port 3000",
    "build": "gatsby build",
    "serve": "gatsby serve",
    "clean": "rm -rf .cache/ && rm -rf public/",
    "format": "prettier --write \"**/*.+(js|jsx|json|css|scss)\"",
    "lint": "tslint --project ./src",
    "precommit": "lint-staged",
    "test": "jest",
    "test:w": "jest --watch"
  },
  "dependencies": {
    "classnames": "2.2.6",
    "gatsby": "2.10.4",
    "path": "0.12.7",
    "prismjs": "1.15.0",
    "react": "16.8.4",
    "react-dom": "16.8.4",
    "react-helmet": "5.2.0",
    "react-hubspot-form": "1.3.7",
    "react-scroll": "1.7.10"
  },
  "devDependencies": {
    "@babel/core": "7.2.2",
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "23.6.0",
    "babel-preset-gatsby": "0.2.0",
    "gatsby-plugin-google-analytics": "2.1.0",
    "gatsby-plugin-manifest": "2.2.0",
    "gatsby-plugin-no-sourcemaps": "2.1.0",
    "gatsby-plugin-purgecss": "4.0.0",
    "gatsby-plugin-react-helmet": "3.1.0",
    "gatsby-plugin-robots-txt": "1.4.0",
    "gatsby-plugin-sass": "2.1.0",
    "gatsby-remark-autolink-headers": "2.1.0",
    "gatsby-remark-prismjs": "3.3.0",
    "gatsby-source-filesystem": "2.1.0",
    "gatsby-transformer-remark": "2.5.0",
    "identity-obj-proxy": "^3.0.0",
    "jest": "23.6.0",
    "node-sass": "4.12.0",
    "prettier": "1.15.3",
    "react-test-renderer": "16.7.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gyss/gatsby-starter"
  }
}
</detail>

Interesting, using npm commands those packages still produce the error for me, but using yarn it all worked. Thanks!

Holy sh*t! This works. I’ve never used yarn before so that was definitely not the first place I looked.

Thank you @jhach and @emiliekmartinez !

Now… if there was only a good reason why yarn works and npm doesn’t, that’d be cool 😃

Upgraded to latest version of gatsby / gatsby-cli / gatsby plugins and everything works perfectly. Thanks a lot

@stephepush Still getting the same error after following your steps. Any other advice?

I intended to post what worked for me in addition to what worked for others as shown in the other posts. My remedy is just another tool on the swiss army knife here 😃

try to delete your package-lock.json

Was having a similar problem when trying to run a project on a new POP!_OS install. Would try and run gatsby develop and the terminal would spit this out:


/usr/lib/node_modules/gatsby-cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

RangeError: Maximum call stack size exceeded
    at /home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:93:46
    at Array.map (<anonymous>)
    at warningWithoutStack (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:93:33)
    at warnAboutUpdateOnUnmounted (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:138:10)
    at Console.console.error.args [as error] (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js:247:39)
    at warningWithoutStack (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:100:32)
    at warnAboutUpdateOnUnmounted (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:138:10)
    at Console.console.error.args [as error] (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js:247:39)

Then I tried npm start and got this output:

/home/stephen/Documents/gatsbyPortfolio/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

RangeError: Maximum call stack size exceeded
    at Array.values (<anonymous>)
    at Console.console.error.args [as error] (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js:247:48)
    at warningWithoutStack (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:100:32)
    at warnAboutUpdateOnUnmounted (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:138:10)
    at Console.console.error.args [as error] (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js:247:39)
    at warningWithoutStack (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:100:32)
    at warnAboutUpdateOnUnmounted (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:10458:5)
    at scheduleWork (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:11868:11)
    at Object.enqueueSetState (/home/stephen/Documents/gatsbyPortfolio/node_modules/react-reconciler/cjs/react-reconciler.development.js:3152:5)
    at GatsbyReporter.Component.setState (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/react/cjs/react.development.js:335:16)
    at GatsbyReporter._addMessage (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/reporters/ink/reporter.js:138:10)
    at Console.console.error.args [as error] (/home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js:247:39)
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! gatsby-starter-default@0.1.0 develop: `gatsby develop`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the gatsby-starter-default@0.1.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/stephen/.npm/_logs/2019-07-14T00_42_43_258Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! gatsby-starter-default@0.1.0 start: `npm run develop`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the gatsby-starter-default@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/stephen/.npm/_logs/2019-07-14T00_42_43_269Z-debug.log

And because I didn’t want to switch to yarn I tried npm upgrade and got this output:

npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

> gatsby-telemetry@1.1.6 postinstall /home/stephen/Documents/gatsbyPortfolio/node_modules/gatsby-telemetry
> node src/postinstall.js

npm WARN ts-pnp@1.1.2 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ gatsby-plugin-sharp@2.2.7
+ gatsby-plugin-offline@2.2.4
+ gatsby@2.13.20
removed 9 packages, updated 17 packages and audited 28378 packages in 35.754s
found 0 vulnerabilities

And ran ‘npm start’ and VIOLAY, the project started on local host.

@jimmyromanticdevil 's solution fixed it for me. yarn upgrade did the trick.

Environment:

  • macOS High Sierra (10.13.6)
  • Gatsby CLI version: 2.7.6
  • Gatsby version: 2.11.3
  • Homebrew 2.1.6
  • Homebrew/homebrew-core (git revision 342c9; last commit 2019-06-28)