Gatsby: RangeError: Maximum call stack size exceeded - map-pages-to-static-query-hashes.js

Created on 2 Jul 2020  Â·  16Comments  Â·  Source: gatsbyjs/gatsby

I already tried everything :(
From reset and remove /node_modules folder, the package-lock.json – as well as update gatsby-cli, and all my packages.

I'm stuck with this error that appears just before the development build process (that remains successful just for a bit) :

image

Here's the shell output:

 ERROR 

Maximum call stack size exceeded



  RangeError: Maximum call stack size exceeded

  - map-pages-to-static-query-hashes.js:73 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:73:23

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9

  - map-pages-to-static-query-hashes.js:111 getDepsFn
    [myfoldername]/[gatsby]/dist/utils/map-pages-to-static-query-hashes.js:111:9


and this is my gatsby info --clipboard:

  System:
    OS: Linux 5.6 Arch Linux
    CPU: (4) x64 Intel(R) Core(TM) i3-5010U CPU @ 2.10GHz
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 14.3.0 - /usr/bin/node
    npm: 6.14.5 - /usr/bin/npm
  Languages:
    Python: 3.8.3 - /usr/bin/python
  npmPackages:
    gatsby: ^2.23.17 => 2.23.17
    gatsby-image: ^2.4.12 => 2.4.12
    gatsby-plugin-disqus: ^1.2.0 => 1.2.0
    gatsby-plugin-emotion: ^4.3.9 => 4.3.9
    gatsby-plugin-feed: ^2.5.10 => 2.5.10
    gatsby-plugin-google-gtag: ^2.1.9 => 2.1.9
    gatsby-plugin-layout: ^1.3.9 => 1.3.9
    gatsby-plugin-manifest: ^2.4.17 => 2.4.17
    gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0
    gatsby-plugin-offline: ^3.2.16 => 3.2.16
    gatsby-plugin-react-helmet: ^3.3.9 => 3.3.9
    gatsby-plugin-robots-txt: ^1.5.1 => 1.5.1
    gatsby-plugin-sharp: ^2.6.17 => 2.6.17
    gatsby-plugin-sitemap: ^2.4.10 => 2.4.10
    gatsby-plugin-svgr: ^2.0.2 => 2.0.2
    gatsby-plugin-typography: ^2.5.9 => 2.5.9
    gatsby-remark-images: ^3.3.17 => 3.3.17
    gatsby-remark-responsive-iframe: ^2.4.10 => 2.4.10
    gatsby-source-filesystem: ^2.3.17 => 2.3.17
    gatsby-transformer-remark: ^2.8.23 => 2.8.23
    gatsby-transformer-sharp: ^2.5.10 => 2.5.10
  npmGlobalPackages:
    gatsby-cli: 2.12.56

Thanks in advance for any help!

bug

Most helpful comment

@pieh @freiksenet

This is my project (I created a stand alone instance to replicate the bug). As written in the README.md: in order to replicate the bug you need to do an explicit npm install [email protected] after the first npm intall.

https://github.com/anonimoconiglio/debug-blog

It's ok if I let this debug instance only for a month online? I already stripped away all my posts, but still have concerns from a SEO point of view (don't like the idea to have duplicated content online).

All 16 comments

following:

For me it seems to be an infinite amount of bugs, using the following versions seemingly fixes it:

"gatsby": "2.23.17",
"gatsby-cli": "2.12.54",

However, locally I can finish build with this combination. But once it is running on the CI I receive this:

/home/runner/work/collect-frontend/collect-frontend/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

RangeError: Maximum call stack size exceeded

any idea why?

EDIT: It is github actions on an ubuntu-latest container, running NPM.

@anonimoconiglio try please:

    "gatsby": "2.23.5",
    "gatsby-cli": "2.12.54",

I ran into this same crash loop following an update earlier today, so it isn't isolated. A rollback resolved it.

The culprit is [email protected]. The last working version for me is [email protected].

(Note there might also be an ongoing npm ecosystem problem right now, because without my current package.lock file Gatsby is crashing with completely different errors than this one.)

I've been with this exact same error the whole day.

➜  gatsby-on-demand git:(sites/shawnmendes) gatsby info

  System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.13.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 83.0.4103.116
    Edge: 83.0.478.58
    Safari: 13.1
  npmPackages:
    gatsby: ^2.21.15 => 2.23.18
    gatsby-background-image: ^1.1.1 => 1.1.1
    gatsby-image: ^2.3.2 => 2.4.12
    gatsby-plugin-emotion: ^4.2.1 => 4.3.9
    gatsby-plugin-eslint: 2.0.8 => 2.0.8
    gatsby-plugin-html-attributes: ^1.0.5 => 1.0.5
    gatsby-plugin-i18n: ^1.0.1 => 1.0.1
    gatsby-plugin-layout: ^1.3.2 => 1.3.9
    gatsby-plugin-manifest: ^2.4.1 => 2.4.17
    gatsby-plugin-offline: 3.2.0 => 3.2.0
    gatsby-plugin-postcss: ^2.3.1 => 2.3.9
    gatsby-plugin-purgecss: ^5.0.0 => 5.0.0
    gatsby-plugin-react-helmet: ^3.3.4 => 3.3.9
    gatsby-plugin-remove-serviceworker: ^1.0.0 => 1.0.0
    gatsby-plugin-root-import: ^2.0.5 => 2.0.5
    gatsby-plugin-s3: ^0.3.3 => 0.3.3
    gatsby-plugin-sass: ^2.3.2 => 2.3.10
    gatsby-plugin-sharp: ^2.5.4 => 2.6.17
    gatsby-plugin-sitemap: ^2.4.5 => 2.4.10
    gatsby-remark-responsive-iframe: ^2.3.1 => 2.4.10
    gatsby-source-drupal: ^3.5.12 => 3.5.20
    gatsby-source-filesystem: ^2.2.2 => 2.3.18
    gatsby-source-shopify: ^3.2.8 => 3.2.18
    gatsby-transformer-sharp: ^2.5.3 => 2.5.10
  npmGlobalPackages:
    gatsby-cli: 2.12.54

I tried the versions you mentioned @kondricz and it didn't work.

This is when I run gatsby develop
Screen Shot 2020-07-02 at 3 10 29 PM

And this is when I run gatsby build
Screen Shot 2020-07-02 at 3 08 51 PM

Downgrading to [email protected] resolved this for me. The issue was occurring with both npm and yarn.

@anonimoconiglio try please:

    "gatsby": "2.23.5",
    "gatsby-cli": "2.12.54",

Hi @kondricz, [email protected] works :+1:

+1 to this happening on:

  System:
    OS: macOS 10.15.5
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.1 - /usr/local/bin/node
    npm: 6.14.5 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 83.0.4103.116
    Safari: 13.1.1
  npmPackages:
    gatsby: ^2.23.5 => 2.23.18
    gatsby-awesome-pagination: ^0.3.6 => 0.3.6
    gatsby-image: ^2.4.12 => 2.4.12
    gatsby-plugin-advanced-sitemap: ^1.5.5 => 1.5.5
    gatsby-plugin-canonical-urls: ^2.3.9 => 2.3.9
    gatsby-plugin-catch-links: ^2.3.10 => 2.3.10
    gatsby-plugin-codegen: ^1.2.0 => 1.2.0
    gatsby-plugin-emotion: ^4.3.9 => 4.3.9
    gatsby-plugin-feed: ^2.5.10 => 2.5.10
    gatsby-plugin-force-trailing-slashes: 1.0.4 => 1.0.4
    gatsby-plugin-global-styles: ^1.0.17 => 1.0.17
    gatsby-plugin-google-analytics: ^2.3.9 => 2.3.9
    gatsby-plugin-postcss: ^2.3.9 => 2.3.9
    gatsby-plugin-preload-fonts: ^1.2.16 => 1.2.16
    gatsby-plugin-prettier-build: ^0.4.3 => 0.4.3
    gatsby-plugin-react-helmet: ^3.3.9 => 3.3.9
    gatsby-plugin-sass: ^2.3.10 => 2.3.10
    gatsby-plugin-sharp: ^2.6.17 => 2.6.17
    gatsby-plugin-sitemap: ^2.4.10 => 2.4.10
    gatsby-plugin-typegen: ^2.2.0 => 2.2.0
    gatsby-plugin-typescript: ^2.4.12 => 2.4.12
    gatsby-plugin-typography: ^2.5.9 => 2.5.9
    gatsby-source-filesystem: ^2.3.18 => 2.3.18
    gatsby-source-ghost: ^4.0.5 => 4.0.5
    gatsby-transformer-json: ^2.4.10 => 2.4.10
    gatsby-transformer-remark: ^2.8.23 => 2.8.23
    gatsby-transformer-sharp: ^2.5.10 => 2.5.10
    gatsby-transformer-yaml: ^2.4.9 => 2.4.9
  npmGlobalPackages:
    gatsby-cli: 2.12.57

2.23.5 still borked here.

Thank you for the report, we reverted the change and published new version 2.23.19.

Hey folks, while the offending change was reverted, we would still appreciate if you could share projects that were experiencing "Maximum call stack size exceeded" error. We will be looking to re-add the code that was causing the error but that would handle those cases and having access to projects that were affected negatively would help us ensure that we handle it correctly

@pieh @freiksenet

This is my project (I created a stand alone instance to replicate the bug). As written in the README.md: in order to replicate the bug you need to do an explicit npm install [email protected] after the first npm intall.

https://github.com/anonimoconiglio/debug-blog

It's ok if I let this debug instance only for a month online? I already stripped away all my posts, but still have concerns from a SEO point of view (don't like the idea to have duplicated content online).

"gatsby": "2.23.5", in package.json works for me too.

npm uninstall -g gatsby-cli
rm -rf node_modules
npm install
npx gatsby develop

Hello folks!

We published a dist-tag with fixes (gatsby@static-query-template), I was wondering if you could test if this works for you.

Just tried on my debug instance (the one I deploy to Github above), seems to work without problems! 

The package went 
from "gatsby": "^2.23.15"
to "gatsby": "^2.23.22-static-query-template.8"

I didn't get any problems on the static-query-template version either

@mahtd @anonimoconiglio Excellent! Thank you for testing!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  Â·  3Comments

rossPatton picture rossPatton  Â·  3Comments

timbrandin picture timbrandin  Â·  3Comments

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments