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 build => yoga-layout | nbind.js:53 | TypeError: Cannot read property 'activities' of undefined #23378

Closed
kuworking opened this issue Apr 22, 2020 · 10 comments
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@kuworking
Copy link

kuworking commented Apr 22, 2020

EDIT: global gatsby-cli version 2.11.15 (perhaps related to #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": "."
  }
}
@kuworking kuworking added the type: bug An issue or pull request relating to a bug in Gatsby label Apr 22, 2020
@vladar
Copy link
Contributor

vladar commented Apr 22, 2020

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.

@kuworking
Copy link
Author

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

@aloenobilis
Copy link

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?

ediblecode added a commit to nice-digital/cks-gatsby that referenced this issue May 15, 2020
@benstaf
Copy link

benstaf commented May 21, 2020

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

@aloenobilis
Copy link

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

@benstaf
Copy link

benstaf commented May 21, 2020

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!

kavithanice pushed a commit to nice-digital/cks-gatsby that referenced this issue May 22, 2020
* CKS-303 Add GTM snippet

* CKS-303 Update package lock after merge

* CKS-303 Update gatsby version

Because of this issue: gatsbyjs/gatsby#23378

* CKS-303 Web app serves from Gatsby public folder

* CKS-303 Add feature test for tag manager

* CKS-303 Add functional tests tasks to vscode

* CKS-303 Fix spelling mistake

* CKS-303 Update packages
@dandv
Copy link
Contributor

dandv commented May 31, 2020

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

@dandv dandv reopened this May 31, 2020
@dandv dandv closed this as completed May 31, 2020
@elevliaykut
Copy link

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

@GetShortstack
Copy link

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

@willymulyana
Copy link

willymulyana commented Oct 16, 2020

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

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

8 participants