gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.21k stars 10.33k forks source link

Callback already called #26439

Closed levino closed 4 years ago

levino commented 4 years ago

Description

I cannot build my gatsby page. I get:

$ yarn build
yarn run v1.22.4
$ gatsby build
success open and validate gatsby-configs - 0.082s
success load plugins - 3.474s
success onPreInit - 0.055s
success delete html and css files from previous builds - 0.015s
success initialize cache - 0.018s
success copy gatsby files - 0.024s
success onPreBootstrap - 0.006s
success createSchemaCustomization - 0.009s
success Checking for changed pages - 0.002s
success source and transform nodes - 0.200s
success building schema - 0.290s
success createPages - 0.003s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.189s
success update schema - 0.042s
success onPreExtractQueries - 0.003s
success extract queries from components - 0.716s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.002s
success onPostBootstrap - 0.009s
info bootstrap finished - 7.387s
success run static queries - 0.213s - 2/2 9.40/s
success run page queries - 0.108s - 17/17 157.18/s
success write out requires - 0.038s
⠸ Building production JavaScript and CSS bundles
[==================          ]   4.539 s 25/38 66% Generating image thumbnails
/home/levin/coding/hardfork/homepage/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: Callback was already called.
    at throwError (/home/levin/coding/hardfork/homepage/node_modules/neo-async/async.js:16:11)
    at /home/levin/coding/hardfork/homepage/node_modules/neo-async/async.js:2818:7
    at processTicksAndRejections (internal/process/task_queues.js:79:11)

IMPORTANT: The process does not even stop (exit with 1) but it just continues and hangs forever.

Steps to reproduce

Check this out and try to build.

Expected result

Page should build without error.

Actual result

Thread hangs (does not stop) shows above error message.

Environment

$ yarn gatsby info --clipboard
yarn run v1.22.4
$ /home/levin/coding/hardfork/homepage/node_modules/.bin/gatsby info --clipboard

  System:
    OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 12.18.2 - /tmp/yarn--1597315685939-0.638949369043861/node
    Yarn: 1.22.4 - /tmp/yarn--1597315685939-0.638949369043861/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v12.18.2/bin/npm
  Languages:
    Python: 2.7.17 - /usr/bin/python
  Browsers:
    Chrome: 84.0.4147.89
    Firefox: 79.0
  npmPackages:
    gatsby: ^2.24.32 => 2.24.47
    gatsby-image: ^2.2.39 => 2.4.16
    gatsby-plugin-catch-links: ^2.1.17 => 2.3.11
    gatsby-plugin-google-tagmanager: ^2.1.15 => 2.3.11
    gatsby-plugin-i18n: ^1.0.1 => 1.0.1
    gatsby-plugin-load-script: ^1.0.6 => 1.1.0
    gatsby-plugin-manifest: ^2.2.23 => 2.4.23
    gatsby-plugin-netlify: ^2.1.22 => 2.3.13
    gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0
    gatsby-plugin-netlify-cms: ^4 => 4.3.11
    gatsby-plugin-nprogress: ^2.1.12 => 2.3.10
    gatsby-plugin-react-helmet: ^3.1.13 => 3.3.10
    gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
    gatsby-plugin-remove-serviceworker: ^1.0.0 => 1.0.0
    gatsby-plugin-robots-txt: ^1.5.0 => 1.5.1
    gatsby-plugin-sass: ^2.1.20 => 2.3.12
    gatsby-plugin-sharp: ^2.2.32 => 2.6.27
    gatsby-plugin-sitemap: ^2.2.19 => 2.4.11
    gatsby-plugin-typescript: ^2.1.15 => 2.4.18
    gatsby-source-filesystem: ^2.1.33 => 2.3.24
    gatsby-transformer-sharp: ^2.3.0 => 2.5.13

Done in 1.53s.
vladar commented 4 years ago

This is a duplicate of #24577 Let's track it there.

Also, check out #25142 as they were able to solve for their use case.

levino commented 4 years ago

I am not sure that the issue is the same. Even if, I tried all of the suggested (voodoo like - as in "just delete and reinstall everything") fixes, none worked. I am stuck. I cannot merge any of my PRs. Please advise. This is a catastrophe...

mcqj commented 4 years ago

Hi @Levino Did you use yarn to install your packages. Interestingly, I am seeing exactly the same issue but I normally use npm for my installs. I cleaned the node_modules directory and used yarn install instead and then it built for me.

antonlvovych commented 4 years ago

@mcqj I use yarn and it reproduces on Netlify's production builds anyway. Netlify uses yarn as well

marharyta commented 3 years ago

@geekiam managed to reproduce it locally, worked as far as reproducing. Did you finally solve this problem?

antonlvovych commented 3 years ago

@marharyta yeah. I've stopped use Gatsby :D

ciokan commented 3 years ago

Same problems with our project. We're 3 developers trying to debug this clusterf** for almost a week by now. I can't even understand why a cli project would depend on a layout engine like yoga. Move your eyes away from a Gatsby project for a month and nothing works when you come back.

logemann commented 3 years ago

Same here. What a braindead stacktrace. Hard to get an idea whats wrong....

levino commented 3 years ago

I was able to fix it for my project. The important thing is that you have to avoid 2 different installed versions of mini-css-extract-plugin.

logemann commented 3 years ago

I also fixed it with the "resolutions" way in packages.json. There was a different thread where the solutions was posted. But thanks anyway for your help.