gatsby build => yoga-layout | nbind.js:53 | TypeError: Cannot read property 'activities' of undefined

Created on 22 Apr 2020  路  10Comments  路  Source: gatsbyjs/gatsby

EDIT: global gatsby-cli version 2.11.15 (perhaps related to https://github.com/gatsbyjs/gatsby/issues/23214 ?)

I can't find what is causing this error

C:\...\Roaming\npm\node_modules\gatsby-cli\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
        throw ex;
        ^

TypeError: Cannot read property 'activities' of undefined
    at getGlobalStatus (C:\...\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\redux\actions.js:50:54)
    at Object.createPendingActivity (C:\...\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\redux\actions.js:140:26)
    at Object.createPendingActivity (C:\...\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\redux\lib\redux.js:481:35)
    at prematureEnd (C:\...\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\index.js:89:19)
    at Object.panic (C:\...\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\index.js:148:5)
    at process.on.reason (C:\...\AppData\Roaming\npm\node_modules\gatsby-cli\lib\index.js:118:10)
    at process.emit (events.js:203:15)
    at processEmit (C:\...\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\signal-exit\index.js:155:32)
    at processEmit [as emit] (C:\CODING\TEST\kuworking-theme-one\node_modules\signal-exit\index.js:161:32)
    at emitPromiseRejectionWarnings (internal/process/promises.js:119:20)
    at process._tickCallback (internal/process/next_tick.js:69:34)

It can be reproduced by

git clone https://github.com/kuworking/kuworking-theme-one.git test
cd test
yarn
gatsby build
  • gatsby develop works, but when I terminate it with Ctrl+N I get the same error

  • This same repo works (both develop and build) when being within workspaces with the dependencies gatsby-theme-one, gatsby-theme-core and gatsby-theme-methods there

  • I've started (in node_modues) deleting and removing everything I could from the three packages and I've ended with I'd say nothing (only gatsby-config and package.json) and still doesn't build giving the same error message

** remaining structure after deleting as much as I've been able trying to isolate the error

kuworking-theme-one

--------------------
gatsby-config.js
--------------------
module.exports = {
  plugins: [`gatsby-theme-kuworking-one`],
};


--------------------
package.json
--------------------
{
  "name": "kuworking-theme-one",
  "version": "0.2.6",
  "description": "kuworking-theme-one",
  "author": "kuworking.com",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/kuworking/kuworking-theme-one.git"
  },
  "dependencies": {
    "gatsby": "2.20.5",
    "gatsby-theme-kuworking-one": "^0.2.3",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  },
  "devDependencies": {
    "babel-eslint": "10.1.0",
    "eslint": "6.8.0",
    "eslint-config-prettier": "6.10.1",
    "eslint-config-standard": "14.1.1",
    "eslint-plugin-import": "2.20.2",
    "eslint-plugin-node": "11.1.0",
    "eslint-plugin-prettier": "3.1.2",
    "eslint-plugin-promise": "4.2.1",
    "eslint-plugin-react": "7.19.0",
    "eslint-plugin-standard": "4.0.1",
    "prettier": "2.0.2"
  },
  "scripts": {
    "develop": "gatsby develop",
    "build": "gatsby build",
    "serve": "gatsby clean && gatsby build && gatsby serve",
    "net": "gatsby develop -H 192.168.1.100",
    "clean": "gatsby clean"
  }
}

gatsby-theme-kuworking-one

--------------------
gatsby-config.js
--------------------
module.exports = () => {
  return {
    plugins: [`gatsby-theme-kuworking-core`],
  }
}


--------------------
package.json
--------------------
{
  "name": "gatsby-theme-kuworking-one",
  "version": "0.2.3",
  "description": "gatsby-theme-kuworking-one",
  "main": "index.js",
  "author": "kuworking.com",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/kuworking/gatsby-theme-kuworking-one.git"
  },
  "peerDependencies": {
    "gatsby": "2.20.5",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  },
  "devDependencies": {
    "gatsby": "2.20.5",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  },
  "dependencies": {
    "@mdx-js/react": "1.5.8",
    "gatsby-theme-kuworking-core": "^0.2.9",
    "react-cookie-consent": "3.0.0",
    "typeface-open-sans": "0.0.75"
  },
  "resolutions": {
    "**/gatsby": "2.20.5",
    "**/@emotion/core": "10.0.28",
    "**/@emotion/styled": "10.0.27",
    "**/@mdx-js/mdx": "1.5.8",
    "**/@mdx-js/react": "1.5.8",
    "theme-ui": "0.3.1"
  }
}

gatsby-theme-kuworking-core

--------------------
gatsby-config.js
--------------------
module.exports = () => {
  return {
    plugins: [
      `gatsby-transformer-sharp`,
      `gatsby-plugin-sharp`,
    ],
  }
}



--------------------
package.json
--------------------
{
  "name": "gatsby-theme-kuworking-core",
  "version": "0.2.9",
  "description": "gatsby-theme-kuworking-core",
  "main": "index.js",
  "author": "kuworking.com",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/kuworking/gatsby-theme-kuworking-core.git"
  },
  "peerDependencies": {
    "@mdx-js/react": "1.5.8",
    "gatsby": "2.20.5",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  },
  "devDependencies": {
    "@mdx-js/react": "1.5.8",
    "gatsby": "2.20.5",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  },
  "dependencies": {
    "@emotion/core": "10.0.28",
    "@emotion/styled": "10.0.27",
    "@mdx-js/mdx": "1.5.8",
    "@mdx-js/react": "1.5.8",
    "emotion-icons": "1.0.0",
    "gatsby-image": "2.3.1",
    "gatsby-plugin-emotion": "4.2.1",
    "gatsby-plugin-feed": "2.4.1",
    "gatsby-plugin-google-tagmanager": "2.2.1",
    "gatsby-plugin-manifest": "2.3.3",
    "gatsby-plugin-mdx": "1.1.6",
    "gatsby-plugin-offline": "3.1.2",
    "gatsby-plugin-page-creator": "2.2.1",
    "gatsby-plugin-react-helmet": "3.2.4",
    "gatsby-plugin-robots-txt": "1.5.0",
    "gatsby-plugin-sharp": "2.5.3",
    "gatsby-plugin-sitemap": "2.3.1",
    "gatsby-plugin-theme-ui": "0.3.0",
    "gatsby-remark-copy-linked-files": "2.2.1",
    "gatsby-remark-images": "3.2.1",
    "gatsby-source-filesystem": "2.2.2",
    "gatsby-theme-kuworking-methods": "^0.1.15",
    "gatsby-transformer-sharp": "2.4.3",
    "react-helmet": "6.0.0",
    "remark-slug": "6.0.0",
    "theme-ui": "0.3.1"
  },
  "resolutions": {
    "**/gatsby": "2.20.5",
    "**/@emotion/core": "10.0.28",
    "**/@emotion/styled": "10.0.27",
    "**/@mdx-js/mdx": "1.5.8",
    "**/@mdx-js/react": "1.5.8",
    "theme-ui": "0.3.1"
  },
  "scripts": {
    "develop": "gatsby develop",
    "build": "gatsby build",
    "serve": "gatsby clean && gatsby build && gatsby serve",
    "net": "gatsby develop -H 192.168.1.100",
    "clean": "gatsby clean",
    "bump": "."
  }
}
bug

Most helpful comment

Yeah, likely related. You have a pinned version of gatsby in package.json: "gatsby": "2.20.5"

Looks like it depends on incompatible gatsby-cli version internally. If you bump gatsby version (even just to "gatsby": "2.20.6") it should fix it.

All 10 comments

Yeah, likely related. You have a pinned version of gatsby in package.json: "gatsby": "2.20.5"

Looks like it depends on incompatible gatsby-cli version internally. If you bump gatsby version (even just to "gatsby": "2.20.6") it should fix it.

Yes, it seems so, bumped to 2.20.29 and it works :)

Bumped to 2.20.29, updated the cli.
Running npm run build (gatsby build ) throws

The above error occurred in the <CLI> component:
    in CLI (created by ConnectedCLI)
    in ConnectedCLI
    in StoreStateProvider
    in App

Is this an issue with the CLI?

I am getting the same error when I copy-paste the folder of my gatsby project. The original works, but the copy shows this error. I have 2.20.20 version

I fixed it with yarn build, just remove the lock, modules folder etc. yarn install, yarn build. Hope that helps.

I am getting the same error when I copy-paste the folder of my gatsby project. The original works, but the copy shows this error. I have 2.20.20 version

bumped to 2.20.29 and it worked!

Sorry, wrong issue, re-filed in #14905.

thats great! When update gatsby version to 2.24.2 it's works!

Also running into this issue with gatsby version 2.24.62 and cli 2.12.99

I'm able to fix same issue after upgrade node.js to latest, from 13.2.0 to 14.14.0 (ref)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments

ghost picture ghost  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

dustinhorton picture dustinhorton  路  3Comments