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.

Gatsby 4 - EPIPE error on Netlify

See original GitHub issue

Preliminary Checks

Description

Just upgraded to Gatsby 4 and everything is working fine locally. I can npm develop and build without issues. However, as soon as I push to Netlify the below error is returned near the end of building.

    4:16:57 PM: error UNHANDLED EXCEPTION write EPIPE
    4:16:57 PM: 
    4:16:57 PM: 
    4:16:57 PM:   Error: write EPIPE
    4:16:57 PM:   
    4:16:57 PM:   - child_process:846 ChildProcess.target._send
    4:16:57 PM:     node:internal/child_process:846:20
    4:16:57 PM:   
    4:16:57 PM:   - child_process:719 ChildProcess.target.send
    4:16:57 PM:     node:internal/child_process:719:19
    4:16:57 PM:   
    4:16:57 PM:   - index.js:290 WorkerPool.sendMessage
    4:16:57 PM:     [repo]/[gatsby-worker]/dist/index.js:290:19
    4:16:57 PM:   
    4:16:57 PM:   - worker-messaging.ts:22 
    4:16:57 PM:     [repo]/[gatsby]/src/utils/jobs/worker-messaging.ts:22:22
    4:16:57 PM:   
    4:16:57 PM: 
    4:16:57 PM: not finished Merge worker state - 0.168s

The Netlify site is deploying on node v16.13.0 (npm v8.1.0) - which is the same as my local environment(Windows 10).

Netlify support believe it’s an issue with Gatsby, which surely can’t be the case if it’s working locally?

Reproduction Link

Unable to provide

Steps to Reproduce

  1. Install the following packages after cloning https://github.com/gatsbyjs/gatsby-starter-wordpress-blog : gatsby: ^4.0.2 => 4.0.2 gatsby-background-image: ^1.5.3 => 1.5.3 gatsby-plugin-feed: ^4.0.0 => 4.0.0 gatsby-plugin-google-tagmanager: ^4.0.0 => 4.0.0 gatsby-plugin-image: ^2.0.0 => 2.0.0 gatsby-plugin-manifest: ^4.0.0 => 4.0.0 gatsby-plugin-nprogress: ^4.0.0 => 4.0.0 gatsby-plugin-offline: ^5.0.0 => 5.0.0 gatsby-plugin-react-helmet: ^5.0.0 => 5.0.0 gatsby-plugin-react-svg: ^3.0.1 => 3.1.0 gatsby-plugin-remove-fingerprints: ^0.0.2 => 0.0.2 gatsby-plugin-sass: ^5.0.0 => 5.0.0 gatsby-plugin-sharp: ^4.0.1 => 4.0.1 gatsby-plugin-sitemap: ^5.0.0 => 5.0.0 gatsby-plugin-styled-components: ^5.0.0 => 5.0.0 gatsby-plugin-svgr-loader: ^0.1.0 => 0.1.0 gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4 gatsby-source-filesystem: ^4.0.0 => 4.0.0 gatsby-source-wordpress: ^6.0.0 => 6.0.0 gatsby-transformer-sharp: ^4.0.0 => 4.0.0

  2. Setup WordPress installation and configure with the following gatsby-config:

 {
    resolve: `gatsby-source-wordpress`,
    options: {
      url: process.env.GRAPHQL_API,
      debug: {
        graphql: {
          writeQueriesToDisk: true,
        },
      },
      production: {
        allow404Images: true,
      },
      auth:
        process.env.NODE_ENV === "production"
          ? {
              htaccess: {
                username: process.env.HTACCESS_USERNAME,
                password: process.env.HTACCESS_PASSWORD,
              },
            }
          : {},
      type: {
        Post: {
          limit:
            process.env.NODE_ENV === `development`
              ? 30
              : process.env.POST_LIMIT || 999999,
        },
        Comment: {
          exclude: true,
        },
        PostFormat: {
          exclude: true,
        },
      },
    },
  },
  1. Deploy to Netlify

Expected Result

Site builds successfully

Actual Result

Site build fails each time with UNHANDLED EXCEPTION write EPIPE error.

Environment

My local environment: 

 System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.10.0
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (95.0.1020.30)
  npmPackages:
    gatsby: ^4.0.2 => 4.0.2
    gatsby-background-image: ^1.5.3 => 1.5.3
    gatsby-plugin-feed: ^4.0.0 => 4.0.0
    gatsby-plugin-google-tagmanager: ^4.0.0 => 4.0.0
    gatsby-plugin-image: ^2.0.0 => 2.0.0
    gatsby-plugin-manifest: ^4.0.0 => 4.0.0
    gatsby-plugin-nprogress: ^4.0.0 => 4.0.0
    gatsby-plugin-offline: ^5.0.0 => 5.0.0
    gatsby-plugin-react-helmet: ^5.0.0 => 5.0.0
    gatsby-plugin-react-svg: ^3.0.1 => 3.1.0
    gatsby-plugin-remove-fingerprints: ^0.0.2 => 0.0.2
    gatsby-plugin-sass: ^5.0.0 => 5.0.0
    gatsby-plugin-sharp: ^4.0.1 => 4.0.1
    gatsby-plugin-sitemap: ^5.0.0 => 5.0.0
    gatsby-plugin-styled-components: ^5.0.0 => 5.0.0
    gatsby-plugin-svgr-loader: ^0.1.0 => 0.1.0
    gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4
    gatsby-source-filesystem: ^4.0.0 => 4.0.0
    gatsby-source-wordpress: ^6.0.0 => 6.0.0
    gatsby-transformer-sharp: ^4.0.0 => 4.0.0
  npmGlobalPackages:
    gatsby-cli: 4.0.0

Netlify site:
    node v16.13.0 (npm v8.1.0) 
    Using ruby version 2.7.1
    Using PHP version 8.0

Config Flags

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:35 (5 by maintainers)

github_iconTop GitHub Comments

17reactions
danielmoessnercommented, Apr 7, 2022

I have the same problem on Gatsby Version 4.11. Why is this issue closed?

14reactions
SamHoltbycommented, Nov 17, 2021

@benlavalley sorry for the radio silence. I ended up moving to Gatsby Cloud for the builds and Netlify for the hosting. Didn’t need to change anything, plus Gatsby builds 70% faster.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UNHANDLED EXCEPTION write EPIP with Gatsby build
“error UNHANDLED EXCEPTION write EPIPE”. The only thing I did was to update gatsby and its dependencies from 4.8 to 4.8.1. Everything was...
Read more >
Gatsby site deployment fails with error UNHANDLED ...
Gatsby site deployment fails with error UNHANDLED EXCEPTION write EPIPE · Try disabling WEBP and AVIF image formats in Gatsby config. · Try...
Read more >
Error UNHANDLED EXCEPTION write EPIPE - Support
Hello i'm trying to deploy my gatsby application on netlify but i'm unable to deploy getting error error UNHANDLED EXCEPTION write EPIPE “build.command”...
Read more >
Gatsby v4 works locally, but timed out on Netlify - Support
djben November 10, 2021, 4:01pm #7. I'm seeing this same 'write EPIPE' error, referenced here with Gatsby (they should probably close this issue, ......
Read more >
Gatsby v4 works locally, but timed out on Netlify - Support
homearanya March 4, 2022, 9:59am #22. I tried with v4.1.3 but it did not work for me either :frowning: Same EPIPE error. I...
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