Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gatsby 4 + Netlify

Tags:

gatsby

netlify

Unable to run gatsby 4 on Netlify due to this error:

    4:07:59 PM: success run queries in workers - 158.327s - 621/621 3.92/s
    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

Here's my Gatsby info:

  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

I'm able to build locally though. Clearing caching and deploying doesn't seem to work either. Any idea what's going wrong?

It's starting to think I'll need to downgrade to Gatsby v3 until this is resolved.

like image 876
Sam Avatar asked Oct 18 '25 19:10

Sam


1 Answers

I believe this issue is related to the mismatching of Node versions between your local environment and Netlify's. This will create a different build dependency installed and potentially some code-breaking like the one you are facing.

You can customize the Node version in a multiple ways but I suggest you just running:

node -v > .nvmrc

This will create a .nvmrc file in the root of your project with the node version (node -v) in it. When Netlify finds this file, automatically set the Node version accordingly.

If this doesn't solve the issue, I think you'll need to downgrade to version 3 or wait for a patch...

If the issue persists, you may need to get rid of gatsby-plugin-offline if you are not using it. EPIPE issues are usually related to the service workers that this plugin sets.

like image 56
Ferran Buireu Avatar answered Oct 22 '25 07:10

Ferran Buireu