Gatsby: ERR_IPC_CHANNEL_CLOSED on gatsby build

Created on 11 Oct 2018  路  15Comments  路  Source: gatsbyjs/gatsby

Description

I keep running into this error when trying to gatsby build:

Unhandled rejection Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
    at process.target.send (internal/child_process.js:578:16)
    at reportSuccess (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/jest-worker/build/child.js:59:11)
    at tryCatcher (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:694:18)
    at Promise._fulfill (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:638:18)
    at MappingPromiseArray.PromiseArray._resolve (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise_array.js:126:19)
    at MappingPromiseArray._promiseFulfilled (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/map.js:101:18)
    at Promise._settlePromise (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:574:26)
    at Promise._settlePromise0 (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/promise.js:694:18)
    at _drainQueueStep (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/Users/sacha/Dev/StateOfJS/surveys/2018/website/node_modules/bluebird/js/release/async.js:147:5)

Any idea what's going on?

Environment

  System:
    OS: macOS High Sierra 10.13.6
    CPU: x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
  Browsers:
    Chrome: 69.0.3497.100
    Firefox: 61.0.2
    Safari: 12.0
  npmPackages:
    gatsby: 2.0.18 => 2.0.18 
    gatsby-link: ^2.0.4 => 2.0.4 
    gatsby-plugin-google-analytics: ^2.0.6 => 2.0.6 
    gatsby-plugin-netlify: ^2.0.1 => 2.0.1 
    gatsby-plugin-react-helmet: ^3.0.0 => 3.0.0 
    gatsby-plugin-sass: ^2.0.1 => 2.0.1 
    gatsby-source-filesystem: ^2.0.1 => 2.0.1 
    gatsby-transformer-yaml: ^2.1.3 => 2.1.3 
  npmGlobalPackages:
    gatsby-cli: 2.4.2
stale? needs more info

Most helpful comment

I'm also experiencing this issue, without any console.logs in my code

All 15 comments

Hi @SachaG, can you provide more details regarding this error? Is it occurring every time you run gatsby build? Did it start happening after any updates?

This went away eventually. I noticed it tended to happen more when I was using console.logs to debug my code, so I wonder if it might be caused by the build process outputting too many logs somehow? Although it might also be a coincidence.

I can confirm in my project, a component doing console.log was causing the build to fail.

@zivc are you also getting ERR_IPC_CHANNEL_CLOSED when the build fails?

Hi,

Mine has magically fixed itself after removing a few console.logs and now works when I add them back.

I can invite you to a repository and you can checkout a specific commit to debug if you'd like as that commit still errors with;

0 info it worked if it ends with ok 1 verbose cli [ '/Users/ash/n/bin/node', 1 verbose cli '/Users/ash/n/bin/npm', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle [email protected]~prebuild: [email protected] 6 info lifecycle [email protected]~build: [email protected] 7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~build: PATH: /Users/ash/n/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/ash/Projects/cheesy-spa/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Users/ash/n/bin 9 verbose lifecycle [email protected]~build: CWD: /Users/ash/Projects/cheesy-spa 10 silly lifecycle [email protected]~build: Args: [ '-c', 'gatsby build' ] 11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null 12 info lifecycle [email protected]~build: Failed to exec build script 13 verbose stack Error: [email protected] build: `gatsby build` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/Users/ash/n/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16) 13 verbose stack at EventEmitter.emit (events.js:182:13) 13 verbose stack at ChildProcess.<anonymous> (/Users/ash/n/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:182:13) 13 verbose stack at maybeClose (internal/child_process.js:961:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5) 14 verbose pkgid [email protected] 15 verbose cwd /Users/ash/Projects/cheesy-spa 16 verbose Darwin 18.0.0 17 verbose argv "/Users/ash/n/bin/node" "/Users/ash/n/bin/npm" "run" "build" 18 verbose node v10.6.0 19 verbose npm v6.1.0 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] build: `gatsby build` 22 error Exit status 1 23 error Failed at the [email protected] build script. 23 error This is probably not a problem with npm. There is likely additional logging output above.

Ash

I'm still getting this error

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.

Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

I'm getting this error as well. Currently investigating. I removed all console.logs from my project.

I'm also experiencing this issue, without any console.logs in my code

@ttstauss @snackersteph I am also getting this error. Have either of you found any work-arounds?

@ttstauss @snackersteph @rafael-nogueras any luck solving this?

@kpennell Sorry: that was like 15 errors ago. At this point I'm not sure what fixed this particular error.

Same here. console.log seem to be the culprit. One quick "workaround" would be to make sure window is defined before logging to the console from the app. Would like to get to a better idea of what the actual issue is though.

Getting it today as well with

    "gatsby": "^2.20.35",
    "gatsby-dynamic-image": "^0.2.0",
    "gatsby-image": "^2.3.5",
    "gatsby-plugin-google-analytics": "^2.3.3",
    "gatsby-plugin-mailchimp": "^5.1.2",
    "gatsby-plugin-material-ui": "^2.1.8",
    "gatsby-plugin-netlify": "^2.2.4",
    "gatsby-plugin-netlify-cms": "^4.2.5",
    "gatsby-plugin-paginate": "^1.12.0",
    "gatsby-plugin-purgecss": "^5.0.0",
    "gatsby-plugin-react-helmet": "^3.2.5",
    "gatsby-plugin-sass": "^2.2.4",
    "gatsby-plugin-sharp": "^2.5.7",
    "gatsby-plugin-twitter": "^2.3.1",
    "gatsby-remark-copy-linked-files": "^2.2.4",
    "gatsby-remark-images": "^3.2.6",
    "gatsby-remark-prismjs": "^3.5.2",
    "gatsby-remark-relative-images": "^0.3.0",
    "gatsby-source-filesystem": "^2.2.5",
    "gatsby-transformer-remark": "^2.8.13",
    "gatsby-transformer-sharp": "^2.4.7",
    "lodash": "^4.17.15",
    "lodash-webpack-plugin": "^0.11.4",
    "netlify-cms-app": "^2.9.6",
    "netlify-cms-media-library-cloudinary": "^1.3.2",
    "netlify-cms-media-library-uploadcare": "^0.5.2",
    "node-sass": "^4.14.0",
    "prismjs": "^1.20.0",

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theduke picture theduke  路  3Comments

hobochild picture hobochild  路  3Comments

andykais picture andykais  路  3Comments

brandonmp picture brandonmp  路  3Comments

kalinchernev picture kalinchernev  路  3Comments