question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'activities' of undefined in yoga-layout-prebuilt

See original GitHub issue

Description

gatsby build and gatsby develop both throw the error above.

Steps to reproduce

git checkout npm i ./node_modules/.bin/gatsby develop or ./node_modules/.bin/gatsby build https://github.com/ochronus/ochronus.online-gatsby

Expected result

Gatsby should build the site

Actual result

Gatsby threw an error

Environment

  System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
    Shell: 3.1.0 - /usr/local/bin/fish
  Binaries:
    Node: 13.13.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
  Languages:
    Python: 3.8.0 - /Users/ochronus/.pyenv/shims/python
  Browsers:
    Chrome: 81.0.4044.113
    Firefox: 75.0
    Safari: 13.1
  npmPackages:
    gatsby: ^2.19.49 => 2.19.49
    gatsby-cli: ^2.11.9 => 2.11.9
    gatsby-image: ^2.3.3 => 2.3.3
    gatsby-plugin-canonical-urls: ^2.2.2 => 2.2.2
    gatsby-plugin-draft: 0.0.5 => 0.0.5
    gatsby-plugin-feed: ^2.4.2 => 2.4.2
    gatsby-plugin-google-analytics: ^2.1.38 => 2.1.38
    gatsby-plugin-manifest: ^2.3.3 => 2.3.3
    gatsby-plugin-netlify: ^2.2.2 => 2.2.2
    gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0
    gatsby-plugin-offline: ^3.1.2 => 3.1.2
    gatsby-plugin-react-helmet: ^3.2.3 => 3.2.3
    gatsby-plugin-s3: ^0.3.3 => 0.3.3
    gatsby-plugin-sharp: ^2.5.3 => 2.5.3
    gatsby-plugin-sitemap: ^2.3.3 => 2.3.3
    gatsby-plugin-typography: ^2.4.2 => 2.4.2
    gatsby-remark-copy-linked-files: ^2.2.1 => 2.2.1
    gatsby-remark-images: ^3.2.1 => 3.2.1
    gatsby-remark-prismjs: ^3.3.36 => 3.3.36
    gatsby-remark-responsive-iframe: ^2.3.1 => 2.3.1
    gatsby-remark-smartypants: ^2.2.2 => 2.2.2
    gatsby-source-filesystem: ^2.2.2 => 2.2.2
    gatsby-transformer-remark: ^2.7.1 => 2.7.1
    gatsby-transformer-sharp: ^2.4.3 => 2.4.3
  npmGlobalPackages:
    gatsby-cli: 2.11.9

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:19
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

64reactions
hanlinc27commented, May 6, 2020

Hi! I had the exact same issue and fixed it by doing the following:

  • Updated my gatsby version to 2.20.24 by running npm update gatsby
  • Deleted my package-lock.json file
  • Ran npm install
  • npm run build finally stopped throwing the error you mentioned above
19reactions
LekoArtscommented, Apr 17, 2020

Thank you for opening this!

You shouldn’t install gatsby-cli in your Gatsby project as it’s not necessary. If you have the CLI globally installed and run gatsby develop inside a project it will use the local copy of the package. If you have not installed it globally you can use npm scripts.

I cloned your repository, removed the gatsby-cli dependency and package-lock.json file and run a npm install and npm run build without problems. The comment from Magnus reinforces that suspicion as he mentioned gatsby-cli himself.

We’re marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'activities' of undefined
I need advice to debug deploy https://app.netlify.com/sites/epic-sammet-97acf3/deploys/5ea68c895418c36f1b1d72e2 Build is failing which is ...
Read more >
Cannot read property 'activities' of undefined - Stack Overflow
TypeError : Cannot read property 'activities' of undefined" and bot is crashing. I expect to bot send a message with link to stream....
Read more >
Gatsby の npmパッケージをアップデートしたときのエラー
... がエラー(Cannot read property 'activities' of undefined)となった ... C:\nodachisoft_www\node_modules\yoga-layout-prebuilt\yoga-layout\ ...
Read more >
M220 Error:Cannot read property 'close' of undefined - M220JS
hello i have a problem my project in m220 it's not starting when I tape a commander for testing with jest it return...
Read more >
TypeError: Cannot read properties of undefined Servicenow ATF
Solved: Hi, I am facing the error TypeError: Cannot read properties of undefined, never seen it, I don't even know why it is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found