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

cli: yoga-layout-prebuilt error on gatsby build #24577

Closed
alexandresgf opened this issue May 28, 2020 · 83 comments
Closed

cli: yoga-layout-prebuilt error on gatsby build #24577

alexandresgf opened this issue May 28, 2020 · 83 comments
Labels
topic: cli Related to the Gatsby CLI type: bug An issue or pull request relating to a bug in Gatsby

Comments

@alexandresgf
Copy link

Description

After an update did using the command npm update and the Gatsby updated from 2.21.17 to 2.22.12 no command did using gatsby-cli works anymore.

Steps to reproduce

  1. Start a new gatsby project or just run npm update; and,
  2. Try to execute gatsby develop or build or serve.

Expected result

Expected to run the development server.

Actual result

/home/alexandre/projects/bestcanais/frontend/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: write EACCES
    at process.target._send (internal/child_process.js:806:20)
    at process.target.send (internal/child_process.js:677:19)
    at /home/alexandre/projects/bestcanais/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/loggers/ipc/index.js:58:13
    at dispatch (/home/alexandre/projects/bestcanais/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:54:5)
    at /home/alexandre/projects/bestcanais/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/internal-actions.js:42:7
    at dispatch (/home/alexandre/projects/bestcanais/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:33:5)
    at /home/alexandre/projects/bestcanais/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:30:28
    at Array.forEach (<anonymous>)
    at dispatch (/home/alexandre/projects/bestcanais/frontend/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:30:12)
    at Reporter.pendingActivity (/home/alexandre/projects/bestcanais/frontend/node_modules/redux/lib/redux.js:483:12)
    at module.exports (/home/alexandre/projects/bestcanais/frontend/node_modules/gatsby/dist/commands/develop-process.js:413:21)
    at Object.<anonymous> (/home/alexandre/projects/bestcanais/frontend/.cache/tmp-27267-PDO5cWsb1RYS:4:5)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
Emitted 'error' event on process instance at:
    at processEmit [as emit] (/home/alexandre/projects/bestcanais/frontend/node_modules/signal-exit/index.js:161:32)
    at internal/child_process.js:810:39
    at processTicksAndRejections (internal/process/task_queues.js:79:11) {
  errno: 'EACCES',
  code: 'EACCES',
  syscall: 'write'
}

Environment

  System:
    OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
    Shell: 4.4.20 - /bin/bash
  Languages:
    Python: 2.7.17 - /home/alexandre/.pyenv/shims/python
  Browsers:
    Chrome: 83.0.4103.61
    Firefox: 76.0.1
  npmPackages:
    gatsby: ^2.21.17 => 2.22.12 
    gatsby-image: ^2.4.5 => 2.4.5 
    gatsby-plugin-google-analytics: ^2.3.2 => 2.3.2 
    gatsby-plugin-manifest: ^2.4.9 => 2.4.9 
    gatsby-plugin-material-ui: ^2.1.9 => 2.1.9 
    gatsby-plugin-offline: ^3.2.7 => 3.2.7 
    gatsby-plugin-react-helmet: ^3.3.2 => 3.3.2 
    gatsby-plugin-sharp: ^2.6.9 => 2.6.9 
    gatsby-source-filesystem: ^2.3.8 => 2.3.8 
    gatsby-source-graphql: ^2.5.2 => 2.5.2 
    gatsby-transformer-sharp: ^2.5.3 => 2.5.3 
@alexandresgf alexandresgf added the type: bug An issue or pull request relating to a bug in Gatsby label May 28, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 28, 2020
@moreguppy
Copy link

Having a similar error when running netlify dev on a gatsby project. Running locally with gatsby develop is OK.

/Users/mikeguppy/Code/xxxx/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

I'm on gatsby version 2.22.9, and gatsby cli version 2.12.21

@pieh pieh added topic: cli Related to the Gatsby CLI status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 28, 2020
@pieh
Copy link
Contributor

pieh commented May 28, 2020

What are node version you are using? We also do need some kind of reproduction for it.

@MrUltimate
Copy link
Contributor

Same issue here #24589

@moreguppy
Copy link

@pieh I'm on node v14.2.0

Also if it helps: macOS Catalina 10.15.4

@moreguppy
Copy link

@pieh I just created a new gatsby project and updated to:

Gatsby CLI version: 2.12.21
Gatsby version: 2.22.12
Node version `14.2.0`

and gatsby develop runs fine.

My issue was with running netlify dev, which threw an exception on that yoga-layout-prebuilt package same as @alexandresgf original post

@alexandresgf
Copy link
Author

alexandresgf commented Jun 2, 2020

What are node version you are using? We also do need some kind of reproduction for it.

node 12.17.0 LTS

I just downgrade and updated the Gatsby version to ~2.21.40, and for now, it is working fine. If I try to update to any 2.22.XX it stops working.

@vladar
Copy link
Contributor

vladar commented Jun 3, 2020

Can be related: #22558, #23214, #24411, #22991 (comment)

@pieh
Copy link
Contributor

pieh commented Jun 4, 2020

I wonder if this is case of some error being eaten by ink and hiding real problem that is not actually related to ink - could you try running CI=1 gatsby develop (or CI=1 netlify dev in case of @moreguppy)?

This should force using "legacy" logger (which is not using yoga-layout-prebuilt) - if there are errors - we can inspect them. If there are no errors we can at least be more sure that it is somewhat related to ink logger

@gu-stav
Copy link
Contributor

gu-stav commented Jun 12, 2020

I'm also running into this problem. Ran the CI=1 gatsby develop which prints:

> lm@1.0.0 develop /home/gustav/Development/lm
> CI=1 gatsby develop

/home/gustav/Development/lm/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: write EACCES
    at process.target._send (internal/child_process.js:811:20)
    at process.target.send (internal/child_process.js:682:19)
    at /home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/loggers/ipc/index.js:58:13
    at dispatch (/home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:54:5)
    at /home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/internal-actions.js:42:7
    at dispatch (/home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:33:5)
    at /home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:30:28
    at Array.forEach (<anonymous>)
    at dispatch (/home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:30:12)
    at Reporter.pendingActivity (/home/gustav/Development/lm/node_modules/redux/lib/redux.js:483:12)
    at module.exports (/home/gustav/Development/lm/node_modules/gatsby/dist/commands/develop-process.js:410:21)
    at Object.<anonymous> (/home/gustav/Development/lm/.cache/tmp-43477-3sp50vYLAonc:4:5)
    at Module._compile (internal/modules/cjs/loader.js:1118:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
    at Module.load (internal/modules/cjs/loader.js:982:32)
    at Function.Module._load (internal/modules/cjs/loader.js:875:14)
Emitted 'error' event on process instance at:
    at processEmit [as emit] (/home/gustav/Development/lm/node_modules/signal-exit/index.js:155:32)
    at internal/child_process.js:815:39
    at processTicksAndRejections (internal/process/task_queues.js:79:11) {
  errno: -13,
  code: 'EACCES',
  syscall: 'write'
}

Gatsby version: 2.23.3

@blainekasten
Copy link
Contributor

You could probably work around this by installing ink and running with the ink logger.

GATSBY_LOGGER=ink gatsby develop

It's strange that gatsby is picking the ipc logger. The reason it's failing is because the ipc logger sends it's data to the parent process. But i don't understand why there is a parent process here when just running gatsby develop.

@gu-stav
Copy link
Contributor

gu-stav commented Jun 17, 2020

@blainekasten Unfortunately not:

kolle-on-xps :: Development/lm » GATSBY_LOGGER=ink npx gatsby develop
/home/gustav/Development/lm/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: write EACCES
    at process.target._send (internal/child_process.js:811:20)
    at process.target.send (internal/child_process.js:682:19)
    at /home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/loggers/ipc/index.js:58:13
    at dispatch (/home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:54:5)
    at /home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/internal-actions.js:42:7
    at dispatch (/home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:33:5)
    at /home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:30:28
    at Array.forEach (<anonymous>)
    at dispatch (/home/gustav/Development/lm/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/redux/index.js:30:12)
    at Reporter.pendingActivity (/home/gustav/Development/lm/node_modules/redux/lib/redux.js:483:12)
    at module.exports (/home/gustav/Development/lm/node_modules/gatsby/dist/commands/develop-process.js:410:21)
    at Object.<anonymous> (/home/gustav/Development/lm/.cache/tmp-46528-C7kBELRkUd53:4:5)
    at Module._compile (internal/modules/cjs/loader.js:1118:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
    at Module.load (internal/modules/cjs/loader.js:982:32)
    at Function.Module._load (internal/modules/cjs/loader.js:875:14)
Emitted 'error' event on process instance at:
    at processEmit [as emit] (/home/gustav/Development/lm/node_modules/signal-exit/index.js:155:32)
    at internal/child_process.js:815:39
    at processTicksAndRejections (internal/process/task_queues.js:79:11) {
  errno: -13,
  code: 'EACCES',
  syscall: 'write'
}

even after installing ink:

kolle-on-xps :: Development/louise-michel » npm ls -g | grep ink
├─┬ ink@2.7.1
│ ├─┬ bin-links@1.1.7
│ │ ├── bin-links@1.1.7 deduped
│ │ ├── bin-links@1.1.7 deduped

Let me know if I can do anything in helping you to debug this ...

@blainekasten
Copy link
Contributor

Oh, I just realized you are using npx, I'm betting that's the problem. Can you try installing gatsby globally?

yarn global add gatsby-cli
gatsby develop

@gu-stav
Copy link
Contributor

gu-stav commented Jun 19, 2020

@blainekasten

kolle-on-xps :: Development/lm » npm ls -g | grep gatsby-cli
├─┬ gatsby-cli@2.12.47

Unfortunately this dosn't change anything. Stacktrace looks exactly the same (even with GATSBY_LOGGER=ink gatsby develop).

I played around with the versions a bit: i breaks for me at 2.22.0 and works fine at 2.21.40 (the last version in 2.21.x). Does this help in any way?

@LekoArts LekoArts changed the title After update Gatsby from 2.21.17 to 2.22.12 it doesn't work anymore cli: yoga-layout-prebuilt error on gatsby build Jun 22, 2020
@wardpeet
Copy link
Contributor

@gustavpursche yes that narrows it down. We can check what changed between those versions. Thank you!

@danabrit danabrit removed the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Jun 24, 2020
liamdalg added a commit to liamdalg/liamdalg.co.uk that referenced this issue Jul 12, 2020
* gatsby is currently at 2.21.40 due to the following issue
  gatsbyjs/gatsby#24577
@blainekasten
Copy link
Contributor

This is the publish commit for 2.21.40.
This is the publish commit for 2.22.0

The only commit between those two is d4ec5e5e081f46ae33578861bcfb29d9554e099a

@blainekasten
Copy link
Contributor

Looks like this is when @mxstbr added the develop-process code.

@blainekasten
Copy link
Contributor

@gustavpursche I'm curious, does npx work for you with other uses non gatsby related?

@gu-stav
Copy link
Contributor

gu-stav commented Jul 14, 2020

@blainekasten The only regular npx command I'm (knowingly) using is npx serve - which works.

I'm also using other globally installed node cli tools and they all work, so I guess it is not a permission issue.

🤷

(I'm on vacation this week but next week I'm happy to dive a bit deeper into the issue since I saw exciting new things at the gatsby horizon)

@gu-stav
Copy link
Contributor

gu-stav commented Jul 29, 2020

@blainekasten Had a look today, but I couldn't find anything useful here. 😭 The only thin I discoverd, which is different from the issue description is, that gatsby build and gatsby serve are working. The problem only occurs when running gatsby develop.

I've also tried it with gatsby-cli installed and without - same result. I'd be super happy if you or @mxstbr do have an idea. Happy to support you with anything you need.

@gu-stav
Copy link
Contributor

gu-stav commented Aug 5, 2020

@alexandresgf @moreguppy @MrUltimate

In case you are also still struggeling with this: I've created/ forked a docker project, which helps me now running gatsby with a recent version: https://github.com/gustavpursche/gatsby-docker

@erezrokah
Copy link
Contributor

Hi @pawelbrzezinski, not yet - but I do have a reproduction for this locally. Will update once I make some progress.

@erezrokah
Copy link
Contributor

erezrokah commented Feb 23, 2021

A possible workaround if you're using yarn is to add the following to package.json:

"resolutions": {
    "mini-css-extract-plugin": "0.11.2"
  },

The underlying cause seems to be that both Gatsby and the CMS plugin have mini-css-extract-plugin as a dependency but with mismatching versions.

Looks like a PR to solve it was already merged, but not released yet.
I'll verify everything works with the latest changes from Gatsby's master branch.

@logemann
Copy link

logemann commented Mar 3, 2021

After doing a rollback of my v3 migration today because of this very ugly gatsby-plugin-netlify-cms package, i suddently getting this error too in my v2 distro. Dont know if this is related to my previous v3 migration but seems unlikely because i reverted and cleaned everything.

I could fix it with what was proposed already:

/*            
     options: {
                modulePath: `${__dirname}/src/cms/cms.js`
     }
*/

But one needs the modulePath right? So this seems not a viable workaround. I must say that i am little bit disappointed that Netlify-CMS gives me such a hard time currently. Not getting v3 is one thing but now even my previous stable distro is kind of defunct.

Update: @erezrokah mini-css fix did the trick too. Thats nice!

@erezrokah
Copy link
Contributor

@logemann can you share the issues you've had with Gatsby v3 and the CMS?

We're in the process of updating it on the CMS repo. The only issue I had so far is that I had to keep gatsby-plugin-emotion at v4 to avoid using emotion@11 (the CMS uses emotion@v10).

@logemann
Copy link

logemann commented Mar 5, 2021

@erezrokah see #29951

fredwu added a commit to fredwu/fredwu.me-v3 that referenced this issue Mar 10, 2021
levino added a commit to hardforkio/homepage that referenced this issue Mar 12, 2021
@technoken35
Copy link

'gatsby-plugin-sass',

This worked for me minus the changes to the SASS config. I had to leave it as 'gatsby-plugin-sass'. Otherwise, it would throw an error when trying to compile my SASS files.

@michaelcorley
Copy link

@erezrokah Could you list out the steps needed to solve this issue? I tried adding the code you said to package.json and running a fresh npm i after deleting node_modules and the package-lock.json file but I'm still getting this error.

@erezrokah
Copy link
Contributor

Hi @michaelcorley the "resolutions" field in package.json only works if you're using yarn.

This tool might work for npm but I haven't tested it.

@jf-home
Copy link

jf-home commented Apr 14, 2021

I had to comment out the import and register entries in cms.js to get around the problem. Would love to see a fix for this (I use npm rather than yarn)

@logemann
Copy link

"Looks like a PR to solve it was already merged, but not released yet."

@erezrokah Any news on this? I thought for a second that there will be a gatsby-plugin-netlify-cms v4.11.0 which solved this issue by using a mini-css-extract-plugin version aligned to gatsby npm module.

@erezrokah
Copy link
Contributor

Hi @logemann, I think updating to the latest versions of Gatsby (v3) and the plugin (v5) should fix this. We are using both of them for www.netlifycms.org without issues:
https://github.com/netlify/netlify-cms/blob/85550eba9e55c65c2f9fa9493c3b114546eab1ea/website/package.json#L22

So this is not fixed in v4 but in v5 + Gatsby v3.

We can consider back porting a fix (pending approval of the maintainers of this repo) if there's a good reason to do it.

@logemann
Copy link

given the fact that not every project will be ported to v3, it would be a good idea to backport it.

@erezrokah
Copy link
Contributor

given the fact that not every project will be ported to v3, it would be a good idea to backport it.

Good point. See PR #31093

@erezrokah
Copy link
Contributor

Hi @logemann, can you try with gatsby-plugin-netlify-cms@4.10.1 per #31093 (comment)?

@LekoArts
Copy link
Contributor

This was fixed with #31093

@logemann
Copy link

@erezrokah removed "resolutions" workaround in packages.json, got the error, used 4.10.1 dependency --> worked! Thanks for your efforts !! #31093 is the man.

@LekoArts LekoArts removed the not stale label May 7, 2021
@jf-home
Copy link

jf-home commented May 14, 2021

As requested by @erezrokah ...I'm having issues with the build as outlined below:

gatsby-plugin-purgecss: Only processing  C:\home\hello-i8n\src\components\all.sass
⠋ Building development bundle
C:\home\hello-i8n\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
        throw ex;
        ^

Error: Callback was already called.
    at throwError (C:\home\hello-i8n\node_modules\neo-async\async.js:16:11)
    at C:\home\hello-i8n\node_modules\neo-async\async.js:2818:7
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

My repo can be found here: https://github.com/jf-home/hello-i8n.

npm ls gatsby-plugin-netlify-cms returns the following:

gatsby-starter-netlify-cms@1.1.3 C:\home\hello-i8n
`-- gatsby-plugin-netlify-cms@4.10.1

The only way that I have found to get around the error is to comment out lines 5 to 16 in \src\cms\cms.js but this then prevents a meaningful preview inside netlify cms.

Thanks in advance for any assistance provided.

@erezrokah
Copy link
Contributor

Hi @jf-home, for some reason you also have mismatching dependencies, see:
image

I was able to fix this by running:

npm install gatsby@2

See PR jf-home/hello-i8n#1

@jf-home
Copy link

jf-home commented May 20, 2021

Hi @erezrokah,

Thanks for the prompt response - that's sorted it! I have learned something new in now to resolve conflicts too - so, again, thank you!

Feel free to close this issue.

@doublejosh
Copy link

Dang, I get this error but I'm using gatsby-source-sanity as my data source.

@AbdallahAbis
Copy link
Contributor

same error using gatsby-source-sanity

@SachaG
Copy link
Contributor

SachaG commented Sep 6, 2022

I'm not using any of these plugins but still got this same error. Any idea how to fix it?

@robwilkerson
Copy link

I seem to be bumping into this as well.

# node --version
v16.18.0
# gatsby -v
Gatsby CLI version: 4.24.0
Gatsby version: 4.24.6

I can't find anything that helps me get past this error in the build process. Any information that might get me a step along the way would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cli Related to the Gatsby CLI type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.