We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Getting "write EPIPE" error when running shopify hydrogen dev

Getting "write EPIPE" error when running shopify hydrogen dev

Rohan007
Shopify Partner
14 3 4

Hi Community,

I'm working on a Hydrogen project on my local machine and getting an error when I run npm run dev (or shopify hydrogen dev). it's not start the server and get error

MiniOxygen: Error during evaluation: Error: write EPIPE
write EPIPE
   at afterWriteDispatched (node:internal/stream_base_commons:161)
   at writeGeneric (node:internal/stream_base_commons:152)
   at _writeGeneric (node:net:958)
   at _write (node:net:970)
   at writeOrBuffer (node:internal/streams/writable:572)
   ...
   at updateConfig (miniflare/src/runtime/index.ts:154)

What does this write EPIPE error mean in the context of miniflare and is there a fix or workaround? Is Node.js 20 officially supported for Hydrogen development?
How to fix it??


My Setup:
    OS: Ubuntu 20.04.6 LTS

     Node: v20.19.2

     npm: 10.8.2 

     Shopify CLI: 3.81.0


Thanks in advance!

Replies 2 (2)
Rohan007
Shopify Partner
14 3 4

Hi Salarmado,
Thank you so much for your help!

I followed your suggestions:

  • Switched to Node.js v18 using nvm
  • Cleared node_modules, package-lock.json, and .cache
  • Reinstalled dependencies and ran npm run dev

The development server does not started even, I'm still seeing the same write EPIPE error from Miniflare during evaluation.

Do you think this might be related to package version mismatches (e.g., undici, react-router, etc.) or is there something else I should try??

Appreciate any further help or suggestions!

Rohan007
Shopify Partner
14 3 4

Hi Salarmado,
Thank you once again for your invaluable help!

I followed these setup commands:

      npm install vite@5.4.19
      npm install @Shopify/cli@3.79.0
      npm install @Shopify/mini-oxygen@3.0.2 --legacy-peer-deps

With this setup, we successfully launched our development server and resolved the EPIPE error. However, we are now encountering two new issues.

Errors after running npm run dev
Upon executing the command, the development server starts successfully, injecting the following environment variables into MiniOxygen:

     PUBLIC_STOREFRONT_ID (from Oxygen)

     PUBLIC_STOREFRONT_API_TOKEN (from Oxygen)

     PUBLIC_STORE_DOMAIN (from Oxygen)

     PRIVATE_STOREFRONT_API_TOKEN (from Oxygen)

     PUBLIC_CUSTOMER_ACCOUNT_API_CLIENT_ID (from Oxygen)

     PUBLIC_CUSTOMER_ACCOUNT_API_URL (from Oxygen)

     SHOP_ID (from Oxygen)

     PUBLIC_CHECKOUT_DOMAIN (from local .env)

Local server is accessible at: http://localhost:3015/

Error details
1. TypeError: Cannot read properties of undefined (reading 'query') Occurs in: loadDeferredData (/home/weblytic/weblytic-store/app/root.jsx:125:6)

2. TypeError: Cannot read properties of undefined (reading 'PUBLIC_CHECKOUT_DOMAIN') Occurs in: handleRequest (/home/weblytic/weblytic-store/app/entry.server.jsx:22:35)

Would you be able to help us resolve these issues? Any guidance or suggestions would be greatly appreciated!